pub struct Cursor<T>{ /* private fields */ }
Expand description
Implementations§
source§impl<T: AsRef<[u8]>> Cursor<T>
impl<T: AsRef<[u8]>> Cursor<T>
sourcepub fn new(inner: T) -> Self
pub fn new(inner: T) -> Self
Create a new Cursor wrapping inner
with an initial position of 0.
Semantics match std::io::Cursor::new()
.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the cursor and returns the inner wrapped data.
Trait Implementations§
source§impl<T: AsRef<[u8]>> ReadInteger for Cursor<T>
impl<T: AsRef<[u8]>> ReadInteger for Cursor<T>
source§fn read_i8_le(&mut self) -> Result<i8>
fn read_i8_le(&mut self) -> Result<i8>
Reads a little-endian i8 returning it’s value or an Error. Read more
source§fn read_u8_le(&mut self) -> Result<u8>
fn read_u8_le(&mut self) -> Result<u8>
Reads a little-endian u8 returning it’s value or an Error. Read more
source§fn read_i8_be(&mut self) -> Result<i8>
fn read_i8_be(&mut self) -> Result<i8>
Reads a big-endian i8 returning it’s value or an Error. Read more
source§fn read_u8_be(&mut self) -> Result<u8>
fn read_u8_be(&mut self) -> Result<u8>
Reads a big-endian u8 returning it’s value or an Error. Read more
source§fn read_i16_le(&mut self) -> Result<i16>
fn read_i16_le(&mut self) -> Result<i16>
Reads a little-endian i16 returning it’s value or an Error. Read more
source§fn read_u16_le(&mut self) -> Result<u16>
fn read_u16_le(&mut self) -> Result<u16>
Reads a little-endian u16 returning it’s value or an Error. Read more
source§fn read_i16_be(&mut self) -> Result<i16>
fn read_i16_be(&mut self) -> Result<i16>
Reads a big-endian i16 returning it’s value or an Error. Read more
source§fn read_u16_be(&mut self) -> Result<u16>
fn read_u16_be(&mut self) -> Result<u16>
Reads a big-endian u16 returning it’s value or an Error. Read more
source§fn read_i32_le(&mut self) -> Result<i32>
fn read_i32_le(&mut self) -> Result<i32>
Reads a little-endian i32 returning it’s value or an Error. Read more
source§fn read_u32_le(&mut self) -> Result<u32>
fn read_u32_le(&mut self) -> Result<u32>
Reads a little-endian u32 returning it’s value or an Error. Read more
source§fn read_i32_be(&mut self) -> Result<i32>
fn read_i32_be(&mut self) -> Result<i32>
Reads a big-endian i32 returning it’s value or an Error. Read more
source§fn read_u32_be(&mut self) -> Result<u32>
fn read_u32_be(&mut self) -> Result<u32>
Reads a big-endian u32 returning it’s value or an Error. Read more
source§fn read_i64_le(&mut self) -> Result<i64>
fn read_i64_le(&mut self) -> Result<i64>
Reads a little-endian i64 returning it’s value or an Error. Read more
source§fn read_u64_le(&mut self) -> Result<u64>
fn read_u64_le(&mut self) -> Result<u64>
Reads a little-endian u64 returning it’s value or an Error. Read more
source§fn read_i64_be(&mut self) -> Result<i64>
fn read_i64_be(&mut self) -> Result<i64>
Reads a big-endian i64 returning it’s value or an Error. Read more
source§fn read_u64_be(&mut self) -> Result<u64>
fn read_u64_be(&mut self) -> Result<u64>
Reads a big-endian u64 returning it’s value or an Error. Read more
source§fn read_i128_le(&mut self) -> Result<i128>
fn read_i128_le(&mut self) -> Result<i128>
Reads a little-endian i128 returning it’s value or an Error. Read more
source§fn read_u128_le(&mut self) -> Result<u128>
fn read_u128_le(&mut self) -> Result<u128>
Reads a little-endian u128 returning it’s value or an Error. Read more
source§impl<T: AsRef<[u8]>> Seek for Cursor<T>
impl<T: AsRef<[u8]>> Seek for Cursor<T>
source§impl<T: AsRef<[u8]> + AsMut<[u8]>> Write for Cursor<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> Write for Cursor<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Cursor<T>where
T: RefUnwindSafe,
impl<T> Send for Cursor<T>where
T: Send,
impl<T> Sync for Cursor<T>where
T: Sync,
impl<T> Unpin for Cursor<T>where
T: Unpin,
impl<T> UnwindSafe for Cursor<T>where
T: 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