Skip to main content

BinaryReader

Trait BinaryReader 

Source
pub trait BinaryReader {
    // Required method
    fn read_from_slice(
        &self,
        reader: &mut UserSliceReader,
        offset: &mut Offset,
    ) -> Result<usize>;
}
Expand description

Trait for types that can be constructed from a binary representation.

See also BinaryReaderMut for the mutable version.

Required Methods§

Source

fn read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut Offset, ) -> Result<usize>

Reads the binary form of self from reader.

offset is the requested offset into the binary representation of self.

On success, returns the number of bytes read from reader.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: ?Sized + BinaryReader, A: Allocator> BinaryReader for Pin<Box<T, A>>

Source§

fn read_from_slice( &self, reader: &mut UserSliceReader, offset: &mut Offset, ) -> Result<usize>

Implementors§