Trait rubble::bytes::FromBytes [−][src]
pub trait FromBytes<'a>: Sized { fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>; }
Expand description
Trait for decoding values from a byte slice.
Required methods
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
Decode a Self
from a byte slice, advancing bytes
to point past the data that was read.
If bytes
contains data not valid for the target type, or contains an insufficient number
of bytes, an error will be returned and the state of bytes
is unspecified (it can point to
arbitrary data).