Skip to main content

BigEndianReader

Struct BigEndianReader 

Source
pub struct BigEndianReader<R> { /* private fields */ }

Implementations§

Source§

impl<R: Read + Seek> BigEndianReader<R>

Source

pub fn new(inner: R) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn read_i32_array<const N: usize>(&mut self) -> Result<[i32; N]>

Source

pub fn read_i32_vec(&mut self, n: usize) -> Result<Vec<i32>>

Source

pub fn read_fixed_string(&mut self, n: usize) -> Result<String>

Source

pub fn read_bytes(&mut self, n: usize) -> Result<Vec<u8>>

Source

pub fn read_null_terminated_string(&mut self, max_len: usize) -> Result<String>

Read a null-terminated string, consuming at most max_len bytes. Stops at the first null byte but does NOT consume padding after it.

Source

pub fn skip(&mut self, n: u64) -> Result<()>

Source

pub fn position(&mut self) -> Result<u64>

Source

pub fn seek_to(&mut self, pos: u64) -> Result<()>

Source

pub fn len(&mut self) -> Result<u64>

Source

pub fn is_empty(&mut self) -> Result<bool>

Auto Trait Implementations§

§

impl<R> Freeze for BigEndianReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for BigEndianReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for BigEndianReader<R>
where R: Send,

§

impl<R> Sync for BigEndianReader<R>
where R: Sync,

§

impl<R> Unpin for BigEndianReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for BigEndianReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for BigEndianReader<R>
where R: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.