Skip to main content

ByteReader

Struct ByteReader 

Source
pub struct ByteReader<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ByteReader<'a>

Source

pub fn new(data: &'a [u8]) -> Self

Source

pub fn u8(&mut self) -> u8

Source

pub fn u16(&mut self) -> u16

Source

pub fn u32(&mut self) -> u32

Source

pub fn u64(&mut self) -> u64

Source

pub fn i8(&mut self) -> i8

Source

pub fn i16(&mut self) -> i16

Source

pub fn i32(&mut self) -> i32

Source

pub fn i64(&mut self) -> i64

Source

pub fn bool(&mut self) -> bool

Source

pub fn bits(&mut self) -> Vec<bool>

Source

pub fn bytes(&mut self, count: usize) -> &'a [u8]

Source

pub fn peek_bytes(&self, count: usize) -> &'a [u8]

Returns a slice of bytes from the current offset without advancing the offset.

Source

pub fn read_until(&mut self, address: usize) -> Vec<u8>

Source

pub fn offset(&self) -> usize

Source

pub fn seek(&mut self, offset: usize)

Source

pub fn uleb128(&mut self) -> u64

Source

pub fn string(&mut self, size: Option<usize>) -> String

Source

pub fn uuid(&mut self) -> String

Source

pub fn datetime(&mut self) -> String

Source

pub fn f32(&mut self) -> f32

Source

pub fn f64(&mut self) -> f64

Source

pub fn slice_bytes(&self, start: usize, end: usize) -> Vec<u8>

Auto Trait Implementations§

§

impl<'a> Freeze for ByteReader<'a>

§

impl<'a> RefUnwindSafe for ByteReader<'a>

§

impl<'a> Send for ByteReader<'a>

§

impl<'a> Sync for ByteReader<'a>

§

impl<'a> Unpin for ByteReader<'a>

§

impl<'a> UnsafeUnpin for ByteReader<'a>

§

impl<'a> UnwindSafe for ByteReader<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V