pub struct Encoder { /* private fields */ }Expand description
Writes values in little-endian, tracking position so padding is correct.
Implementations§
Source§impl Encoder
impl Encoder
pub fn new() -> Self
Sourcepub fn at_offset(offset: usize) -> Self
pub fn at_offset(offset: usize) -> Self
Start encoding at a non-zero offset, for a buffer that continues one that has already been written.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn finish_from(self, skip: usize) -> Vec<u8> ⓘ
pub fn finish_from(self, skip: usize) -> Vec<u8> ⓘ
The bytes written, discarding skip leading bytes of offset padding.
pub fn finish(self) -> Vec<u8> ⓘ
pub fn byte(&mut self, v: u8)
pub fn u16(&mut self, v: u16)
pub fn u32(&mut self, v: u32)
pub fn u64(&mut self, v: u64)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Encoder
impl Freeze for Encoder
impl Move for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
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