Struct winter_utils::SliceReader
source · pub struct SliceReader<'a> { /* private fields */ }
Expand description
Implements ByteReader trait for a slice of bytes.
Implementations
sourceimpl<'a> SliceReader<'a>
impl<'a> SliceReader<'a>
Trait Implementations
sourceimpl<'a> ByteReader for SliceReader<'a>
impl<'a> ByteReader for SliceReader<'a>
sourcefn read_u8(&mut self) -> Result<u8, DeserializationError>
fn read_u8(&mut self) -> Result<u8, DeserializationError>
Returns a single byte read from
self
. Read moresourcefn read_u16(&mut self) -> Result<u16, DeserializationError>
fn read_u16(&mut self) -> Result<u16, DeserializationError>
Returns a u16 value read from
self
in little-endian byte order. Read moresourcefn read_u32(&mut self) -> Result<u32, DeserializationError>
fn read_u32(&mut self) -> Result<u32, DeserializationError>
Returns a u32 value read from
self
in little-endian byte order. Read moresourcefn read_u64(&mut self) -> Result<u64, DeserializationError>
fn read_u64(&mut self) -> Result<u64, DeserializationError>
Returns a u64 value read from
self
in little-endian byte order. Read moresourcefn read_u128(&mut self) -> Result<u128, DeserializationError>
fn read_u128(&mut self) -> Result<u128, DeserializationError>
Returns a u128 value read from
self
in little-endian byte order. Read moresourcefn read_u8_vec(&mut self, len: usize) -> Result<Vec<u8>, DeserializationError>
fn read_u8_vec(&mut self, len: usize) -> Result<Vec<u8>, DeserializationError>
Returns a byte vector of the specified length read from
self
. Read moresourcefn read_u8_array<const N: usize>(
&mut self
) -> Result<[u8; N], DeserializationError>
fn read_u8_array<const N: usize>(
&mut self
) -> Result<[u8; N], DeserializationError>
Returns a byte array of length
N
reade from self
.sourcefn has_more_bytes(&self) -> bool
fn has_more_bytes(&self) -> bool
Returns true if there are more bytes left to be read from
self
.Auto Trait Implementations
impl<'a> RefUnwindSafe for SliceReader<'a>
impl<'a> Send for SliceReader<'a>
impl<'a> Sync for SliceReader<'a>
impl<'a> Unpin for SliceReader<'a>
impl<'a> UnwindSafe for SliceReader<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more