pub struct Cursor<'a> {
pub buf: &'a [u8],
pub next: usize,
}Fields§
§buf: &'a [u8]§next: usizeImplementations§
Trait Implementations§
source§impl<'a> Read for Cursor<'a>
impl<'a> Read for Cursor<'a>
source§fn read_exact(&mut self, len: usize) -> Result<&[u8], Error>
fn read_exact(&mut self, len: usize) -> Result<&[u8], Error>
Take a slice of the next len bytes and advance the position by len.
source§fn read_u32_be(&mut self) -> Result<u32, Error>
fn read_u32_be(&mut self) -> Result<u32, Error>
Read 4 bytes as unsigned integer in big endian order.
(most significant byte first)
source§fn read_var<T: VarInt>(&mut self) -> Result<T, Error>
fn read_var<T: VarInt>(&mut self) -> Result<T, Error>
Read unsigned integer with variable length. Read more
source§fn read_var_signed<T: SignedVarInt>(&mut self) -> Result<Signed<T>, Error>
fn read_var_signed<T: SignedVarInt>(&mut self) -> Result<Signed<T>, Error>
Read unsigned integer with variable length. Read more
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Cursor<'a>
impl<'a> Send for Cursor<'a>
impl<'a> Sync for Cursor<'a>
impl<'a> Unpin for Cursor<'a>
impl<'a> UnwindSafe for Cursor<'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