pub struct Decoder<'input> { /* private fields */ }Implementations§
Source§impl<'input> Decoder<'input>
impl<'input> Decoder<'input>
pub const fn new(input: &'input [u8]) -> Self
pub const fn position(&self) -> usize
pub const fn remaining(&self) -> usize
pub fn read_u8(&mut self) -> Result<u8, DecodeError>
pub fn read_u16_le(&mut self) -> Result<u16, DecodeError>
pub fn read_u32_le(&mut self) -> Result<u32, DecodeError>
pub fn read_u64_le(&mut self) -> Result<u64, DecodeError>
pub fn read_compact_size(&mut self) -> Result<u64, DecodeError>
pub fn read_compact_usize( &mut self, maximum: usize, _field: &'static str, ) -> Result<usize, DecodeError>
pub fn read_varbytes( &mut self, maximum: usize, field: &'static str, ) -> Result<Vec<u8>, DecodeError>
pub fn read_array<const LENGTH: usize>( &mut self, ) -> Result<[u8; LENGTH], DecodeError>
pub fn read_slice(&mut self, length: usize) -> Result<&'input [u8], DecodeError>
pub fn read_bounded_vec( &mut self, length: usize, maximum: usize, ) -> Result<Vec<u8>, DecodeError>
pub fn finish(self) -> Result<(), DecodeError>
Trait Implementations§
Auto Trait Implementations§
impl<'input> Freeze for Decoder<'input>
impl<'input> RefUnwindSafe for Decoder<'input>
impl<'input> Send for Decoder<'input>
impl<'input> Sync for Decoder<'input>
impl<'input> Unpin for Decoder<'input>
impl<'input> UnsafeUnpin for Decoder<'input>
impl<'input> UnwindSafe for Decoder<'input>
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