[−][src]Struct sunrise_kernel::utils::CursorRead
A minimal Cursor for writing, for use in libcore.
See https://doc.rust-lang.org/std/io/struct.Cursor.html
Fields
data: &'a [u8]
Data backing this cursor.
pos: Cell<usize>
Position of the cursor in the data.
Implementations
impl<'a> CursorRead<'a>
[src]
pub fn new(data: &[u8]) -> CursorRead
[src]
Creates a new cursor wrapping the provided underlying in-memory buffer.
pub fn pos(&self) -> usize
[src]
Returns the current position of this cursor.
pub fn read_u8<BO>(&self) -> u8 where
BO: ByteOrder,
[src]
BO: ByteOrder,
Reads an u8 in the given byteorder.
pub fn read_u16<BO>(&self) -> u16 where
BO: ByteOrder,
[src]
BO: ByteOrder,
Reads an u16 in the given byteorder.
pub fn read_u32<BO>(&self) -> u32 where
BO: ByteOrder,
[src]
BO: ByteOrder,
Reads an u32 in the given byteorder.
pub fn read_u64<BO>(&self) -> u64 where
BO: ByteOrder,
[src]
BO: ByteOrder,
Reads an u64 in the given byteorder.
pub fn assert(&self, v: &[u8])
[src]
Reads v.len()
bytes from the stream, and asserts that it is equal to
v
.
pub fn skip_read(&self, bytelen: usize) -> &[u8]
[src]
Skips bytelen
bytes, returning a slice to them for inspection.
pub fn read_raw<T>(&self) -> T where
T: Copy,
[src]
T: Copy,
Reads the given structure from the bytestream.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for CursorRead<'a>
impl<'a> Send for CursorRead<'a>
impl<'a> !Sync for CursorRead<'a>
impl<'a> Unpin for CursorRead<'a>
impl<'a> UnwindSafe for CursorRead<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,