pub trait ReadBytes {
// Required methods
fn read_bytes_le(bytes: &[u8]) -> Self;
fn read_bytes_be(bytes: &[u8]) -> Self;
}Expand description
Endian aware read from a byte buffer.
Required Methods§
sourcefn read_bytes_le(bytes: &[u8]) -> Self
fn read_bytes_le(bytes: &[u8]) -> Self
Reads the bytes of self from the given buffer, in little endian order.
Panics
Panics if the size of bytes is too small to store the value of self.
sourcefn read_bytes_be(bytes: &[u8]) -> Self
fn read_bytes_be(bytes: &[u8]) -> Self
Reads the bytes of self from the given buffer, in big endian order.
Panics
Panics if the size of bytes is too small to store the value of self.
Object Safety§
This trait is not object safe.