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>>
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.
Provided Methods
fn fib_encode(self) -> Result<BitVec, EncodeError<Self>>
Fibonacci-encodes an integer into a bit vector and returns the resulting vector.
Errors
Returns an error when attempting to encode 0.