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

Returns the position in the stream.

Returns the size of the stream.

Reads a number of bytes from the stream.

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.

Read in a u8 (KS: u1)

Read in an i8 (KS: s1)

Reads in a little endian u16 (KS: u2)

Reads in a big endian u16 (KS: u2)

Reads in a little endian u32 (KS: u4)

Reads in a big endian u32 (KS: u4)

Reads in a little endian u64 (KS: u8)

Reads in a big endian u64 (KS: u8)

Reads in a little endian i16 (KS: s2)

Reads in a big endian i16 (KS: s2)

Reads in a little endian i32 (KS: s4)

Reads in a big endian i32 (KS: s4)

Reads in a little endian i64 (KS: s8)

Reads in a big endian i64 (KS: s8)

Reads in a little endian f32 (KS: f4)

Reads in a big endian f32 (KS: f4)

Reads in a little endian f64 (KS: f8)

Reads in a big endian f64 (KS: f8)

Implementors