Trait StaticCodeWrite

Source
pub trait StaticCodeWrite<E: Endianness, CW: CodesWrite<E> + ?Sized> {
    // Required method
    fn write(&self, writer: &mut CW, value: u64) -> Result<usize, CW::Error>;
}
Expand description

A trait providing a method to write a code to a CodesWrite specified as a trait type parameter.

The difference with DynamicCodeWrite is that this trait is more specialized, as the CodesWrite is a parameter of the trait.

For a fixed code this trait may be implemented by storing a function pointer.

Required Methods§

Source

fn write(&self, writer: &mut CW, value: u64) -> Result<usize, CW::Error>

Implementors§

Source§

impl<E: Endianness, CW: CodesWrite<E> + ?Sized> StaticCodeWrite<E, CW> for Codes

Source§

impl<E: Endianness, CW: CodesWrite<E> + ?Sized> StaticCodeWrite<E, CW> for FuncCodeWriter<E, CW>

Source§

impl<E: Endianness, CW: CodesWrite<E> + ?Sized, const CODE: usize> StaticCodeWrite<E, CW> for ConstCode<CODE>

Source§

impl<W: StaticCodeWrite<E, CW>, const ZETA: usize, const GOLOMB: usize, const EXP_GOLOMB: usize, const RICE: usize, const PI: usize, E: Endianness, CW: CodesWrite<E> + ?Sized> StaticCodeWrite<E, CW> for CodesStatsWrapper<W, ZETA, GOLOMB, EXP_GOLOMB, RICE, PI>