Skip to main content

Reader

Struct Reader 

Source
pub struct Reader<'a, 'b> { /* private fields */ }
Expand description

Fluent byte reader over a FileAnalyze buffer.

Implementations§

Source§

impl<'a, 'b> Reader<'a, 'b>

Source

pub fn wrap(fa: &'a mut FileAnalyze<'b>) -> Self

Source

pub fn peek_raw(&self, n: usize) -> Option<&[u8]>

Source

pub fn peek_magic<const N: usize>(&self, magic: &[u8; N]) -> bool

Source

pub fn read_raw(&mut self, n: usize) -> Option<&[u8]>

Source

pub fn skip(&mut self, n: usize) -> Option<()>

Source

pub fn remain(&self) -> usize

Source

pub fn element_begin(&mut self, name: &str)

Source

pub fn element_end(&mut self)

Source

pub fn element_offset(&self) -> usize

Source

pub fn stream_prepare(&mut self, kind: StreamKind) -> usize

Source

pub fn set_field( &mut self, kind: StreamKind, pos: usize, parameter: &str, value: impl Into<Ztring>, )

Source

pub fn force_field( &mut self, kind: StreamKind, pos: usize, parameter: &str, value: impl Into<Ztring>, )

Source

pub fn be_u8(&mut self, name: &str) -> Option<u8>

Source

pub fn be_u16(&mut self, name: &str) -> Option<u16>

Source

pub fn be_u24(&mut self, name: &str) -> Option<u32>

Source

pub fn be_u32(&mut self, name: &str) -> Option<u32>

Source

pub fn be_u40(&mut self, name: &str) -> Option<u64>

Source

pub fn be_u48(&mut self, name: &str) -> Option<u64>

Source

pub fn be_u56(&mut self, name: &str) -> Option<u64>

Source

pub fn be_u64(&mut self, name: &str) -> Option<u64>

Source

pub fn be_u128(&mut self, name: &str) -> Option<u128>

Source

pub fn le_u8(&mut self, name: &str) -> Option<u8>

Source

pub fn le_u16(&mut self, name: &str) -> Option<u16>

Source

pub fn le_u24(&mut self, name: &str) -> Option<u32>

Source

pub fn le_u32(&mut self, name: &str) -> Option<u32>

Source

pub fn le_u64(&mut self, name: &str) -> Option<u64>

Source

pub fn peek_be_u16(&self) -> Option<u16>

Source

pub fn peek_be_u32(&self) -> Option<u32>

Source

pub fn peek_be_u64(&self) -> Option<u64>

Source

pub fn peek_le_u16(&self) -> Option<u16>

Source

pub fn peek_le_u32(&self) -> Option<u32>

Source

pub fn be_f32(&mut self, name: &str) -> Option<f32>

Source

pub fn be_f64(&mut self, name: &str) -> Option<f64>

Source

pub fn le_f32(&mut self, name: &str) -> Option<f32>

Source

pub fn le_f64(&mut self, name: &str) -> Option<f64>

Source

pub fn be_f80(&mut self, name: &str) -> Option<f64>

Source

pub fn fourcc(&mut self, name: &str) -> Option<u32>

Source

pub fn bits<F, T>(&mut self, f: F) -> Option<T>
where F: FnOnce(&mut BitReader<'_, 'b>) -> Option<T>,

Auto Trait Implementations§

§

impl<'a, 'b> !UnwindSafe for Reader<'a, 'b>

§

impl<'a, 'b> Freeze for Reader<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for Reader<'a, 'b>

§

impl<'a, 'b> Send for Reader<'a, 'b>

§

impl<'a, 'b> Sync for Reader<'a, 'b>

§

impl<'a, 'b> Unpin for Reader<'a, 'b>

§

impl<'a, 'b> UnsafeUnpin for Reader<'a, 'b>

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.