Trait IterParams

Source
pub trait IterParams {
    type Input;
    type Output;

    // Required methods
    fn bits() -> usize;
    fn buffer() -> usize;
    fn shift() -> usize;
    fn to_byte(input: Self::Input) -> u8;
    fn to_output(bits: u8) -> Self::Output;

    // Provided methods
    fn post_shift() -> usize { ... }
    fn iterations() -> usize { ... }
    fn validate() { ... }
}

Required Associated Types§

Source

type Input

Type to consume when buffering.

Source

type Output

Type to yield at each iteration.

Required Methods§

Source

fn bits() -> usize

Number of bits to consume at each iteration.

Source

fn buffer() -> usize

Number of input symbols to consume when buffering.

Source

fn shift() -> usize

Amount to shift buffer after loading an input symbol.

Source

fn to_byte(input: Self::Input) -> u8

Convert input symbol to a byte.

Source

fn to_output(bits: u8) -> Self::Output

Convert bits to output type.

Provided Methods§

Source

fn post_shift() -> usize

Amount to shift buffer after all buffering, so the bits are lined up at the MSB.

Source

fn iterations() -> usize

Number of iterations before buffering.

Source

fn validate()

Verify the parameters are supported.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§