pub struct ByteReader<'a> { /* private fields */ }Implementations§
Source§impl<'a> ByteReader<'a>
impl<'a> ByteReader<'a>
pub fn new(bytes: &'a [u8]) -> Self
pub fn read_c_str(&mut self) -> Result<String>
pub fn read_u8(&mut self) -> Result<u8>
pub fn read_u16_be(&mut self) -> Result<u16>
pub fn read_u16_le(&mut self) -> Result<u16>
pub fn read_u32_be(&mut self) -> Result<u32>
pub fn read_u32_le(&mut self) -> Result<u32>
pub fn read_u64_be(&mut self) -> Result<u64>
pub fn read_u64_le(&mut self) -> Result<u64>
pub fn advance(&mut self, n: usize) -> Result<()>
pub fn align(&mut self, n: usize)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Done reading all the bytes and cursor is corrently pointing out of bound of the array
pub fn read_block(&mut self, n: usize) -> Result<&[u8]>
pub fn read_block_to_end(&mut self) -> Result<&[u8]>
Sourcepub fn get_block_at(&self, position: usize, length: usize) -> Result<&[u8]>
pub fn get_block_at(&self, position: usize, length: usize) -> Result<&[u8]>
Does not advance the cursor
pub fn rewind(&mut self, n: usize) -> Result<()>
pub fn reset(&mut self)
pub fn get_position(&self) -> usize
pub fn set_position(&mut self, n: usize) -> Result<()>
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