[−][src]Struct sunrise_libutils::CursorWrite
A minimal Cursor for writing, for use in libcore.
See https://doc.rust-lang.org/std/io/struct.Cursor.html
Fields
data: &'a mut [u8]
Data backing this cursor.
pos: usize
Position of the cursor in the data.
Implementations
impl<'a> CursorWrite<'a>
[src]
pub fn new(data: &mut [u8]) -> CursorWrite
[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 skip_write(&mut self, bytelen: usize) -> &mut [u8]
[src]
Skip the given amount of bytes, returning a mutable slice to it.
pub fn write_u8<BO: ByteOrder>(&mut self, v: u8)
[src]
Writes an u8 in the given byte ordering.
pub fn write_u16<BO: ByteOrder>(&mut self, v: u16)
[src]
Writes a u16 in the given byte ordering.
pub fn write_u32<BO: ByteOrder>(&mut self, v: u32)
[src]
Writes a u32 in the given byte ordering.
pub fn write_u64<BO: ByteOrder>(&mut self, v: u64)
[src]
Writes a u64 in the given byte ordering.
pub fn write(&mut self, v: &[u8])
[src]
Writes the given byte slice entirely.
pub fn write_raw<T: Copy>(&mut self, v: T)
[src]
Writes the given structure.
Trait Implementations
Auto Trait Implementations
impl<'a> Send for CursorWrite<'a>
impl<'a> Sync for CursorWrite<'a>
impl<'a> Unpin for CursorWrite<'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>,