Struct yaxpeax_arch::U8Reader

source ·
pub struct U8Reader<'a> { /* private fields */ }
Expand description

a struct for Reader impls that can operate on units of u8.

Implementations§

source§

impl<'a> U8Reader<'a>

source

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

Trait Implementations§

source§

impl Reader<u16, U16be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U16be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U16be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u16, U16le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U16le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U16le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u16, U32be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U32be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U32be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u16, U32le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U32le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U32le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u16, U64be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U64be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U64be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u16, U64le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U64le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U64le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u16, u8> for U8Reader<'_>

source§

fn next(&mut self) -> Result<u8, ReadError>

source§

fn next_n(&mut self, buf: &mut [u8]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u16

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u16

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, U16be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U16be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U16be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, U16le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U16le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U16le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, U32be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U32be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U32be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, U32le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U32le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U32le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, U64be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U64be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U64be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, U64le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U64le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U64le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u32, u8> for U8Reader<'_>

source§

fn next(&mut self) -> Result<u8, ReadError>

source§

fn next_n(&mut self, buf: &mut [u8]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u32

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u32

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, U16be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U16be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U16be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, U16le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U16le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U16le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, U32be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U32be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U32be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, U32le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U32le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U32le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, U64be> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U64be, ReadError>

source§

fn next_n(&mut self, buf: &mut [U64be]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, U64le> for U8Reader<'_>

source§

fn next(&mut self) -> Result<U64le, ReadError>

source§

fn next_n(&mut self, buf: &mut [U64le]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.
source§

impl Reader<u64, u8> for U8Reader<'_>

source§

fn next(&mut self) -> Result<u8, ReadError>

source§

fn next_n(&mut self, buf: &mut [u8]) -> Result<(), ReadError>

read buf-many items from this reader in bulk. if Reader cannot read buf-many items, return ReadError::ExhaustedInput.
source§

fn mark(&mut self)

mark the current position as where to measure offset against.
source§

fn offset(&mut self) -> u64

the difference, in Address, between the current Reader position and its last mark. when created, a Reader’s initial position is marked, so creating a Reader and immediately calling offset() must return Address::zero().
source§

fn total_offset(&mut self) -> u64

the difference, in Address, between the current Reader position and the initial offset when constructed.

Auto Trait Implementations§

§

impl<'a> Freeze for U8Reader<'a>

§

impl<'a> RefUnwindSafe for U8Reader<'a>

§

impl<'a> !Send for U8Reader<'a>

§

impl<'a> !Sync for U8Reader<'a>

§

impl<'a> Unpin for U8Reader<'a>

§

impl<'a> UnwindSafe for U8Reader<'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>,

§

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>,

§

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.