Expand description
High-level safe wrappers around minilzo, backed by the absperf-minilzo-sys crate. This was created instead of using existing crates because the existing crates didn’t export all of the necessary functions (notably the adler32 checksum one and the version strings), and the interfaces weren’t as flexible as they could have been.
For the most part, to use this, just import CompressInto and DecompressInto and start using their methods on your byte slices. For decompression into a new std::vec::Vec, make sure you read the documentation on the DecompressInto implementation for Vec<u8>.
Enums§
- Error
- Simple wrapper around minilzo error types
Traits§
- Compress
Into - Compression trait. Implemented for [u8], allowing compressing into [u8] and Vec<u8>
- Decompress
Into - Decompression trait. Implemented for [u8], allowing decompressing into [u8] and Vec<u8>
Functions§
- adler32
- A convenience call for adler32_chain(1, input)
- adler32_
chain - Compute adler32. This is made to be chainable. On initial call, set the prev_checksum parameter to 1, or use the plain adler32 call given x: [u8; 4], adler32(&x) == adler32_chain(1, &x) == adler32_chain(adler32(&x[..2]), &x[2..])
- init
- Run initialization, which currently just appears to be a simple pointer size check. You should probably still do this, just in case it gets more complex and necessary in the future or somehow the crate versions end up mixed up
- version
- Get the version as a (major, minor) tuple
- version_
date - Get the version date as a string
- version_
raw - Get the raw version as reported by minilzo
- version_
str - Get the version as a string