Struct Cursor
pub struct Cursor<'a> {
pub buf: &'a [u8],
pub next: usize,
}Fields§
§buf: &'a [u8]§next: usizeImplementations§
Trait Implementations§
§impl<'a> Read for Cursor<'a>
impl<'a> Read for Cursor<'a>
§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.
§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)
§fn read_var<T>(&mut self) -> Result<T, Error>where
T: VarInt,
fn read_var<T>(&mut self) -> Result<T, Error>where
T: VarInt,
Read unsigned integer with variable length. Read more
§fn read_var_signed<T>(&mut self) -> Result<Signed<T>, Error>where
T: SignedVarInt,
fn read_var_signed<T>(&mut self) -> Result<Signed<T>, Error>where
T: SignedVarInt,
Read unsigned integer with variable length. Read more
§fn read_string(&mut self) -> Result<&str, Error>
fn read_string(&mut self) -> Result<&str, Error>
Read string of variable length.
Auto Trait Implementations§
impl<'a> Freeze for Cursor<'a>
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more