Trait fibonacci_codec::EncodeOne[][src]

pub trait EncodeOne where
    Self: Sized + Debug + Send + Sync
{ fn fib_encode_mut(self, vec: &mut BitVec) -> Result<(), EncodeError<Self>>; fn fib_encode(self) -> Result<BitVec, EncodeError<Self>> { ... } }

Allows encoding single primitive integers (> 0) using fibonacci coding.

Required methods

fn fib_encode_mut(self, vec: &mut BitVec) -> Result<(), EncodeError<Self>>[src]

Fibonacci-encodes an integer onto the end of an existing bit vector. It extends the bit vector by the numer of bits required to hold the output.

Errors

Returns an error when attempting to encode 0.

Loading content...

Provided methods

fn fib_encode(self) -> Result<BitVec, EncodeError<Self>>[src]

Fibonacci-encodes an integer into a bit vector and returns the resulting vector.

Errors

Returns an error when attempting to encode 0.

Loading content...

Implementations on Foreign Types

impl EncodeOne for u8[src]

impl EncodeOne for u16[src]

impl EncodeOne for u32[src]

impl EncodeOne for u64[src]

Loading content...

Implementors

Loading content...