Trait binread::BinRead[][src]

pub trait BinRead: Sized {
    type Args: Any + Copy;
    fn read_options<R: Read + Seek>(
        reader: &mut R,
        options: &ReadOptions,
        args: Self::Args
    ) -> BinResult<Self>; fn read<R: Read + Seek>(reader: &mut R) -> BinResult<Self> { ... }
fn read_args<R: Read + Seek>(
        reader: &mut R,
        args: Self::Args
    ) -> BinResult<Self> { ... }
fn after_parse<R: Read + Seek>(
        &mut self,
        _: &mut R,
        _: &ReadOptions,
        _: Self::Args
    ) -> BinResult<()> { ... }
fn args_default() -> Option<Self::Args> { ... } }
Expand description

A BinRead trait allows reading a structure from anything that implements io::Read and io::Seek BinRead is implemented on the type to be read out of the given reader

Associated Types

The type of arguments needed to be supplied in order to read this type, usually a tuple.

NOTE: For types that don’t require any arguments, use the unit (()) type. This will allow read to be used.

Required methods

Read the type from the reader

Provided methods

Read the type from the reader while assuming no arguments have been passed

Panics

Panics if there is no args_default implementation

Read the type from the reader using the specified arguments

The default arguments to be used when using the read shortcut method. Override this for any type that optionally requries arguments

Implementations on Foreign Types

Implementors