Struct mindus::data::DataRead

source ·
pub struct DataRead<'d> { /* private fields */ }

Implementations§

source§

impl<'d> DataRead<'d>

source

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

source

pub fn read_bool(&mut self) -> Result<bool, ReadError>

source

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

source

pub fn read_i8(&mut self) -> Result<i8, ReadError>

source

pub fn read_u16(&mut self) -> Result<u16, ReadError>

source

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

source

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

source

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

source

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

source

pub fn read_u64(&mut self) -> Result<u64, ReadError>

source

pub fn read_i64(&mut self) -> Result<i64, ReadError>

source

pub fn read_f64(&mut self) -> Result<f64, ReadError>

source

pub fn read_utf(&mut self) -> Result<&'d str, ReadError>

source

pub fn eat(&mut self, n: usize) -> Result<&'d [u8], ReadError>

source

pub fn readN<const N: usize>(&mut self) -> Result<[u8; N], ReadError>

source

pub fn read_bytes(&mut self, dst: &mut [u8]) -> Result<(), ReadError>

source

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

source

pub fn read_chunk<E: Error + From<ReadError>, T>( &mut self, big: bool, f: impl FnOnce(&mut DataRead<'_>) -> Result<T, E> ) -> Result<T, E>

source

pub fn read_vec( &mut self, dst: &mut Vec<u8>, len: usize ) -> Result<(), ReadError>

source

pub fn read_map( &mut self, dst: &mut HashMap<String, String> ) -> Result<(), ReadError>

source

pub fn deflate(&mut self) -> Result<Vec<u8>, DecompressError>

Trait Implementations§

source§

impl<'d> Debug for DataRead<'d>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for DataRead<'_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d> RefUnwindSafe for DataRead<'d>

§

impl<'d> Send for DataRead<'d>

§

impl<'d> Sync for DataRead<'d>

§

impl<'d> Unpin for DataRead<'d>

§

impl<'d> UnwindSafe for DataRead<'d>

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> Join<T, 1, 1, T> for T

source§

fn join(self, with: T) -> [T; 2]

Join a array and an scalar together. For joining two arrays together, see Couple. Read more
source§

impl<T, const O: usize> Join<T, 1, O, [T; O]> for T

source§

fn join(self, with: [T; O]) -> [T; { _ }]

Join a array and an scalar together. For joining two arrays together, see Couple. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.