Trait kaitai::runtime::KaitaiStream [−][src]
pub trait KaitaiStream: Read + Seek {}Show 25 methods
fn is_eof(&mut self) -> Result<bool> { ... } fn pos(&mut self) -> Result<u64> { ... } fn size(&mut self) -> Result<u64> { ... } fn read_bytes(&mut self, count: usize) -> Result<Vec<u8>> { ... } fn read_bytes_full(&mut self) -> Result<Vec<u8>> { ... } fn read_bytes_term(
&mut self,
term: char,
flags: &[TerminatorFlags]
) -> Result<Vec<u8>> { ... } fn ensure_fixed_contents(&mut self, expected: &[u8]) -> Result<()> { ... } fn read_u1(&mut self) -> Result<u8> { ... } fn read_s1(&mut self) -> Result<i8> { ... } fn read_u2le(&mut self) -> Result<u16> { ... } fn read_u2be(&mut self) -> Result<u16> { ... } fn read_u4le(&mut self) -> Result<u32> { ... } fn read_u4be(&mut self) -> Result<u32> { ... } fn read_u8le(&mut self) -> Result<u64> { ... } fn read_u8be(&mut self) -> Result<u64> { ... } fn read_s2le(&mut self) -> Result<i16> { ... } fn read_s2be(&mut self) -> Result<i16> { ... } fn read_s4le(&mut self) -> Result<i32> { ... } fn read_s4be(&mut self) -> Result<i32> { ... } fn read_s8le(&mut self) -> Result<i64> { ... } fn read_s8be(&mut self) -> Result<i64> { ... } fn read_f4le(&mut self) -> Result<f32> { ... } fn read_f4be(&mut self) -> Result<f32> { ... } fn read_f8le(&mut self) -> Result<f64> { ... } fn read_f8be(&mut self) -> Result<f64> { ... }
Expand description
Trait that adds useful functions to all structs that implement Read and Seek.
Provided methods
Reads a number of bytes from the stream.
fn read_bytes_full(&mut self) -> Result<Vec<u8>>
fn read_bytes_full(&mut self) -> Result<Vec<u8>>
Read the remaining bytes in the stream.
Read bytes up to a terminator.
The Include flag determines whether the terminator is included in the return value. If the Consumed flag is set, the stream points to the character after the terminator, otherwise it points to the terminator.
Ensures that the contents of the buffer is equal to the expected value.