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, usualy 10..13
  • ej - The number of bits in the length, usually 4..5
  • c - The initial fill byte of the buffer, usually 0x20 (space)

Restrictions

  • ej must be larger than 0
  • ei must be larger than ej
  • ei + ej must be at least 8
  • ei + 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.

Get the ei parameter.

Get the ej parameter.

Get the c parameter.

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.

Decompress the input data into the output.

It will be asserted at runtime that the buffer is at least 1 << EI.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.