Struct binary_reader::BinaryReader[][src]

pub struct BinaryReader {
    pub data: Vec<u8>,
    pub pos: usize,
    pub length: usize,
    pub endian: Endian,
}
Expand description

Binary reader.

Fields

data: Vec<u8>

The buffer data.

pos: usize

The current position.

length: usize

The length of the buffer.

endian: Endian

The endian of the buffer.

Implementations

Initialize BinaryReader from u8 slice.

Initialize BinaryReader from u8 Vector.

Initialize BinaryReader from std::fs::File.

Set endian for read method.

Jump position.

Read provided length size bytes.

Read provided length size bytes. Similar to BinaryReader::read but this returns std::io::Result instead of Option.

Read cstr. Read String(s) until null(aka 0x00).

Read signed 8 bit integer

Read signed 16 bit integer

Read signed 32 bit integer

Read signed 64 bit integer

Read 32 bit float

Read 64 bit float

Read unsigned 8 bit integer

Read unsigned 16 bit integer

Read unsigned 32 bit integer

Read unsigned 64 bit integer

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.