Trait BinaryFile

Source
pub trait BinaryFile {
    // Required methods
    fn from_reader<R: Read>(reader: R) -> Result<Self>
       where Self: Sized;
    fn to_writer<W: Write>(&self, writer: W) -> Result<()>;
}
Expand description

Trait for any struct that can converted to and from a binary stream.

Required Methods§

Source

fn from_reader<R: Read>(reader: R) -> Result<Self>
where Self: Sized,

Reads a binary stream and returns an instance of Self

Source

fn to_writer<W: Write>(&self, writer: W) -> Result<()>

Writes the strut as a binary 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 BinaryFile for Level

Available on crate features dev-be-legacy-alpha and be only.