pub struct ByteReader<'a> { /* private fields */ }
Implementations§
source§impl<'a> ByteReader<'a>
impl<'a> ByteReader<'a>
pub fn new(data: &'a [u8]) -> Self
sourcepub fn read_u8(&mut self) -> ByteReaderResult<u8>
pub fn read_u8(&mut self) -> ByteReaderResult<u8>
§Errors
Will return an error if there are not enough bytes to read.
sourcepub fn read_u16(&mut self) -> ByteReaderResult<u16>
pub fn read_u16(&mut self) -> ByteReaderResult<u16>
§Errors
Will return an error if there are not enough bytes to read.
sourcepub fn read_u32(&mut self) -> ByteReaderResult<u32>
pub fn read_u32(&mut self) -> ByteReaderResult<u32>
§Errors
Will return an error if there are not enough bytes to read.
sourcepub fn read_u64(&mut self) -> ByteReaderResult<u64>
pub fn read_u64(&mut self) -> ByteReaderResult<u64>
§Errors
Will return an error if there are not enough bytes to read.
sourcepub fn read_string(&mut self) -> ByteReaderResult<String>
pub fn read_string(&mut self) -> ByteReaderResult<String>
§Errors
Will return an error if there are not enough bytes to read or if the UTF-8 bytes are invalid.
sourcepub fn read_uuid(&mut self) -> ByteReaderResult<Uuid>
pub fn read_uuid(&mut self) -> ByteReaderResult<Uuid>
§Errors
Will return an error if there are not enough bytes to read or if the UUID bytes are invalid.
pub fn read_remaining_bytes(&mut self) -> Vec<u8>
pub fn is_empty(&self) -> bool
pub fn remaining(&self) -> usize
Auto Trait Implementations§
impl<'a> Freeze for ByteReader<'a>
impl<'a> RefUnwindSafe for ByteReader<'a>
impl<'a> Send for ByteReader<'a>
impl<'a> Sync for ByteReader<'a>
impl<'a> Unpin for ByteReader<'a>
impl<'a> UnwindSafe for ByteReader<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more