Skip to main content

BitConvert

Trait BitConvert 

Source
pub trait BitConvert<T>: Sized {
    // Required methods
    fn read_value_from<R: BitRead>(&self, reader: &mut R) -> Result<T>;
    fn write_value_to<W: BitWrite>(
        &self,
        value: &T,
        writer: &mut W,
    ) -> Result<()>;
}
Expand description

A trait for a converter that allows the reading and writing of types though a converter

Required Methods§

Source

fn read_value_from<R: BitRead>(&self, reader: &mut R) -> Result<T>

Reads a value from the given reader.

Source

fn write_value_to<W: BitWrite>(&self, value: &T, writer: &mut W) -> Result<()>

Writes this value to the given writer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§