pub struct CursorWriter { /* private fields */ }Expand description
A byte-buffer writer with a movable cursor position.
Implementations§
Source§impl CursorWriter
impl CursorWriter
pub fn new() -> Self
pub fn with_capacity(cap: usize) -> Self
pub fn write_u8(&mut self, v: u8)
pub fn write_u16_le(&mut self, v: u16)
pub fn write_u32_le(&mut self, v: u32)
pub fn write_f32_le(&mut self, v: f32)
pub fn write_bytes(&mut self, data: &[u8])
pub fn position(&self) -> usize
pub fn set_position(&mut self, pos: usize)
pub fn seek_start(&mut self)
pub fn seek_end(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn clear(&mut self)
pub fn remaining(&self) -> usize
Trait Implementations§
Source§impl Clone for CursorWriter
impl Clone for CursorWriter
Source§fn clone(&self) -> CursorWriter
fn clone(&self) -> CursorWriter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CursorWriter
impl Debug for CursorWriter
Auto Trait Implementations§
impl Freeze for CursorWriter
impl RefUnwindSafe for CursorWriter
impl Send for CursorWriter
impl Sync for CursorWriter
impl Unpin for CursorWriter
impl UnsafeUnpin for CursorWriter
impl UnwindSafe for CursorWriter
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