pub struct Cursor<'a>(/* private fields */);Expand description
Cursor over a borrowed byte slice, reading big-endian values from the front.
Implementations§
Trait Implementations§
impl<'a> Copy for Cursor<'a>
Source§impl<'a> ReadBytes<'a> for Cursor<'a>
impl<'a> ReadBytes<'a> for Cursor<'a>
Source§fn read_bytes(&mut self, len: usize) -> Result<&'a [u8]>
fn read_bytes(&mut self, len: usize) -> Result<&'a [u8]>
Consumes exactly
len bytes, or fails with Error::UnexpectedEof.Source§fn repeat_by_u16<T>(
&mut self,
fun: impl FnMut(&mut Self) -> Result<T>,
) -> Result<Vec<T>>where
Self: Sized,
fn repeat_by_u16<T>(
&mut self,
fun: impl FnMut(&mut Self) -> Result<T>,
) -> Result<Vec<T>>where
Self: Sized,
Reads a
u16 count, then applies fun that many times.Source§fn repeat_by_u8<T>(
&mut self,
fun: impl FnMut(&mut Self) -> Result<T>,
) -> Result<Vec<T>>where
Self: Sized,
fn repeat_by_u8<T>(
&mut self,
fun: impl FnMut(&mut Self) -> Result<T>,
) -> Result<Vec<T>>where
Self: Sized,
Reads a
u8 count, then applies fun that many times.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> UnsafeUnpin 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