pub struct RawReader<'a> { /* private fields */ }
Expand description
Helper to easily read binary values from an u8-slice, triggering EncodingError on out-of-bounds errors.
Implementations§
source§impl<'a> RawReader<'a>
impl<'a> RawReader<'a>
pub fn with<'b>(data: &'b [u8]) -> Selfwhere
'b: 'a,
pub fn read_u8(&mut self) -> Result<u8, EncodingError>
pub fn read_u64(&mut self, len: usize) -> Result<u64, EncodingError>
pub fn read_i64(&mut self, len: usize) -> Result<i64, EncodingError>
pub fn read_var_u64(&mut self) -> Result<u64, EncodingError>
pub fn read_var_i64(&mut self) -> Result<i64, EncodingError>
pub fn read_bytes(&mut self, len: usize) -> Result<&'a [u8], EncodingError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn read_f32(&mut self) -> Result<f32, EncodingError>
pub fn read_f64(&mut self) -> Result<f64, EncodingError>
pub fn read_var_string(&mut self) -> Result<&'a [u8], EncodingError>
pub fn skip(&mut self, length: usize) -> Result<(), EncodingError>
pub fn data(&self) -> &'a [u8] ⓘ
pub fn truncate(&mut self, max: usize)
Trait Implementations§
source§impl<'a> PartialEq for RawReader<'a>
impl<'a> PartialEq for RawReader<'a>
impl<'a> Copy for RawReader<'a>
impl<'a> Eq for RawReader<'a>
impl<'a> StructuralEq for RawReader<'a>
impl<'a> StructuralPartialEq for RawReader<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for RawReader<'a>
impl<'a> Send for RawReader<'a>
impl<'a> Sync for RawReader<'a>
impl<'a> Unpin for RawReader<'a>
impl<'a> UnwindSafe for RawReader<'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