Struct lzss::LzssDyn [−][src]
pub struct LzssDyn { /* fields omitted */ }
Expand description
Dynamic parameters for de-/compression (see Lzss for compile-time parameters).
Parameters
ei
- The number of bits in the offset, usualy10..13
ej
- The number of bits in the length, usually4..5
c
- The initial fill byte of the buffer, usually0x20
(space)
Restrictions
ej
must be larger than0
ei
must be larger thanej
ei + ej
must be at least 8ei + ej
must be 24 or less
Example
let my_lzss = LzssDyn::new(10, 4, 0x20)?; let input = b"Example Data"; let result = my_lzss.compress( SliceReader::new(input), VecWriter::with_capacity(30), ); assert_eq!(result.void_unwrap().len(), 14); // the output is 14 bytes long
Implementations
Create new Lzss parameters.
If the parameter are not valid (see above) an error is returned.
alloc/std
Compress the input data into the output.
The buffer, with 2 * (1 << EI)
bytes, is allocated on the heap.
Compress the input data into the output.
It will be asserted at runtime that the buffer is at least 2 * (1 << EI)
.
alloc/std
Decompress the input data into the output.
The buffer, with 1 << EI
bytes, is allocated on the heap.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LzssDyn
impl UnwindSafe for LzssDyn
Blanket Implementations
Mutably borrows from an owned value. Read more