Trait chariot_io_tools::ReadExt
[−]
[src]
pub trait ReadExt { fn read_u8(&mut self) -> Result<u8>; fn read_i8(&mut self) -> Result<i8>; fn read_u16(&mut self) -> Result<u16>; fn read_i16(&mut self) -> Result<i16>; fn read_u32(&mut self) -> Result<u32>; fn read_i32(&mut self) -> Result<i32>; fn read_f32(&mut self) -> Result<f32>; fn read_sized_str(&mut self, len: usize) -> Result<String>; fn read_and_decompress(self) -> Result<Vec<u8>>; }
All of these methods assume little endian
Required Methods
fn read_u8(&mut self) -> Result<u8>
Read and return exactly one byte from the stream
fn read_i8(&mut self) -> Result<i8>
fn read_u16(&mut self) -> Result<u16>
fn read_i16(&mut self) -> Result<i16>
fn read_u32(&mut self) -> Result<u32>
fn read_i32(&mut self) -> Result<i32>
fn read_f32(&mut self) -> Result<f32>
fn read_sized_str(&mut self, len: usize) -> Result<String>
Read in the desired amount of bytes and convert it into a string. Assumes the slice is either null terminated, or that the string contents occupy the full width.
fn read_and_decompress(self) -> Result<Vec<u8>>
Read in zlib compressed data for the remainder of the stream
Implementors
impl<T> ReadExt for T where
T: Read,