bitstream_io::write

Trait HuffmanWrite

Source
pub trait HuffmanWrite<E: Endianness> {
    // Required method
    fn write_huffman<T>(
        &mut self,
        tree: &WriteHuffmanTree<E, T>,
        symbol: T,
    ) -> Result<()>
       where T: Ord + Copy;
}
Expand description

A trait for anything that can write Huffman codes of a given endianness to an output stream

Required Methods§

Source

fn write_huffman<T>( &mut self, tree: &WriteHuffmanTree<E, T>, symbol: T, ) -> Result<()>
where T: Ord + Copy,

Writes Huffman code for the given symbol to the stream.

§Errors

Passes along any I/O error from the underlying stream.

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§

Source§

impl<N, E> HuffmanWrite<E> for BitCounter<N, E>
where E: Endianness, N: AddAssign + From<u32>,

Source§

impl<N, E> HuffmanWrite<E> for BitRecorder<N, E>
where E: Endianness, N: Copy + From<u32> + AddAssign + Rem<Output = N> + Eq,

Source§

impl<W: Write, E: Endianness> HuffmanWrite<E> for BitWriter<W, E>