compressed_string

Crates.iocompressed_string
lib.rscompressed_string
version1.0.0
sourcesrc
created_at2018-12-30 18:36:57.066202
updated_at2018-12-30 18:36:57.066202
descriptionString stored in memory in a compressed form, using the DEFLATE algorithm
homepagehttps://crates.rs/crates/compressed_string
repository
max_upload_size
id104604
size5,697
Kornel (kornelski)

documentation

README

In-memory compressed String

If your application keeps many long strings in RAM, you can reduce its memory usage by compressing the strings.

Optionally, if with_serde feature is enabled, it can also be used to serialize and deserialize strings in binary formats in an already-compressed form.

use compressed_string::ComprString;

let raw = "It uses the deflate algorithm, which has a small header overhead, \
so it's suitable even for short-ish strings";

let compr = ComprString::new(raw);

assert_eq!(109, raw.len());
assert_eq!(84, compr.compressed_len());

println!("{}", compr);
let string = compr.to_string();
Commit count: 0

cargo fmt