Struct spacetimedb_sats::buffer::Cursor
source · pub struct Cursor<I> {
pub buf: I,
pub pos: Cell<usize>,
}
Expand description
A cursor based [BufReader<'de>
] implementation.
Fields§
§buf: I
The underlying input read from.
pos: Cell<usize>
The position within the reader.
Implementations§
Trait Implementations§
source§impl<'de, I: AsRef<[u8]>> BufReader<'de> for &'de Cursor<I>
impl<'de, I: AsRef<[u8]>> BufReader<'de> for &'de Cursor<I>
source§fn get_slice(&mut self, size: usize) -> Result<&'de [u8], DecodeError>
fn get_slice(&mut self, size: usize) -> Result<&'de [u8], DecodeError>
Reads and returns a byte slice of
.len() = size
advancing the cursor.source§fn get_u8(&mut self) -> Result<u8, DecodeError>
fn get_u8(&mut self) -> Result<u8, DecodeError>
Reads a
u8
in little endian (LE) encoding from the input. Read moresource§fn get_u16(&mut self) -> Result<u16, DecodeError>
fn get_u16(&mut self) -> Result<u16, DecodeError>
Reads a
u16
in little endian (LE) encoding from the input. Read moresource§fn get_u32(&mut self) -> Result<u32, DecodeError>
fn get_u32(&mut self) -> Result<u32, DecodeError>
Reads a
u32
in little endian (LE) encoding from the input. Read moresource§fn get_u64(&mut self) -> Result<u64, DecodeError>
fn get_u64(&mut self) -> Result<u64, DecodeError>
Reads a
u64
in little endian (LE) encoding from the input. Read moresource§fn get_u128(&mut self) -> Result<u128, DecodeError>
fn get_u128(&mut self) -> Result<u128, DecodeError>
Reads a
u128
in little endian (LE) encoding from the input. Read moresource§fn get_i8(&mut self) -> Result<i8, DecodeError>
fn get_i8(&mut self) -> Result<i8, DecodeError>
Reads an
i8
in little endian (LE) encoding from the input. Read moresource§fn get_i16(&mut self) -> Result<i16, DecodeError>
fn get_i16(&mut self) -> Result<i16, DecodeError>
Reads an
i16
in little endian (LE) encoding from the input. Read moresource§fn get_i32(&mut self) -> Result<i32, DecodeError>
fn get_i32(&mut self) -> Result<i32, DecodeError>
Reads an
i32
in little endian (LE) encoding from the input. Read moresource§fn get_i64(&mut self) -> Result<i64, DecodeError>
fn get_i64(&mut self) -> Result<i64, DecodeError>
Reads an
i64
in little endian (LE) encoding from the input. Read moreAuto Trait Implementations§
impl<I> !RefUnwindSafe for Cursor<I>
impl<I> Send for Cursor<I>where
I: Send,
impl<I> !Sync for Cursor<I>
impl<I> Unpin for Cursor<I>where
I: Unpin,
impl<I> UnwindSafe for Cursor<I>where
I: UnwindSafe,
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