pub trait FromReader<'a>: Sized {
// Required method
fn from_reader(
reader: &mut BinaryReader<'a>,
) -> Result<Self, BinaryReaderError>;
}
Expand description
A trait implemented for items that can be decoded directly from a
BinaryReader
, or that which can be parsed from the WebAssembly binary
format.
Note that this is also accessible as a BinaryReader::read
method.
Required Methods§
Sourcefn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self, BinaryReaderError>
fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self, BinaryReaderError>
Attempts to read Self
from the provided binary reader, returning an
error if it is unable to do so.
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.