[][src]Struct binary_reader::BinaryReader

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

Fields

data: Vec<u8>pos: usizelength: usizeendian: Endian

Implementations

impl BinaryReader[src]

pub fn from_u8(get: &[u8]) -> BinaryReader[src]

Initialize BinaryReader from u8 slice.

pub fn from_vec(vec: &Vec<u8>) -> BinaryReader[src]

Initialize BinaryReader from u8 Vector.

pub fn from_file(file: &mut File) -> BinaryReader[src]

Initialize BinaryReader from std::fs::File.

pub fn set_endian(&mut self, endian: Endian)[src]

Set endian for read method.

pub fn jmp(&mut self, pos: usize)[src]

jump position.

pub fn adv(&mut self, size: usize)[src]

pub fn align(&mut self, size: usize)[src]

pub fn read(&mut self, size: usize) -> Option<&[u8]>[src]

Read length size bytes.

pub fn read_cstr(&mut self) -> String[src]

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

pub fn read_i8(&mut self) -> Result<i8>[src]

read signed 8 bit integer

pub fn read_i16(&mut self) -> Result<i16>[src]

read signed 16 bit integer

pub fn read_i32(&mut self) -> Result<i32>[src]

read signed 32 bit integer

pub fn read_i64(&mut self) -> Result<i64>[src]

read signed 64 bit integer

pub fn read_f32(&mut self) -> Result<f32>[src]

read 32 bit float

pub fn read_f64(&mut self) -> Result<f64>[src]

read 64 bit float

pub fn read_u8(&mut self) -> Result<u8>[src]

read unsigned 8 bit integer

pub fn read_u16(&mut self) -> Result<u16>[src]

read unsigned 16 bit integer

pub fn read_u32(&mut self) -> Result<u32>[src]

read unsigned 32 bit integer

pub fn read_u64(&mut self) -> Result<u64>[src]

read unsigned 64 bit integer

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.