pub struct ByteReader<'a> { /* private fields */ }Expand description
Cursor over a byte slice, mirroring ByteWriter.
Implementations§
Source§impl<'a> ByteReader<'a>
impl<'a> ByteReader<'a>
Sourcepub fn u8(&mut self) -> Result<u8, DecodeError>
pub fn u8(&mut self) -> Result<u8, DecodeError>
One raw byte.
Sourcepub fn varint(&mut self) -> Result<u64, DecodeError>
pub fn varint(&mut self) -> Result<u64, DecodeError>
Unsigned LEB128.
Sourcepub fn svarint(&mut self) -> Result<i64, DecodeError>
pub fn svarint(&mut self) -> Result<i64, DecodeError>
Zigzag-mapped signed LEB128.
Sourcepub fn f64(&mut self) -> Result<f64, DecodeError>
pub fn f64(&mut self) -> Result<f64, DecodeError>
Little-endian f64.
Sourcepub fn block(&mut self) -> Result<&'a [u8], DecodeError>
pub fn block(&mut self) -> Result<&'a [u8], DecodeError>
Length-prefixed byte block.
Trait Implementations§
Source§impl<'a> Clone for ByteReader<'a>
impl<'a> Clone for ByteReader<'a>
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> UnsafeUnpin 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