pub trait DataInput: Read {
// Required methods
fn byte_order(&self) -> ByteOrder;
fn set_byte_order(&mut self, order: ByteOrder);
// Provided methods
fn read_fully(&mut self, bytes: &mut [u8]) -> Result<()> { ... }
fn read_byte(&mut self) -> Result<u8> { ... }
}
Expand description
A Trait for types that can perform binary IO Reads
Required Methods§
Sourcefn byte_order(&self) -> ByteOrder
fn byte_order(&self) -> ByteOrder
Gets the current byte order mode
Sourcefn set_byte_order(&mut self, order: ByteOrder)
fn set_byte_order(&mut self, order: ByteOrder)
Sets the current byte order mode
Provided Methods§
Sourcefn read_fully(&mut self, bytes: &mut [u8]) -> Result<()>
fn read_fully(&mut self, bytes: &mut [u8]) -> Result<()>
Reads exactly bytes.len() bytes into bytes. Returns an error if an End of File prevents reading the entire array.