pub struct ZonWriter { /* private fields */ }Implementations§
Source§impl ZonWriter
impl ZonWriter
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_bytes(&self) -> &[u8] ⓘ
Sourcepub fn write_u32(&mut self, val: u32) -> u32
pub fn write_u32(&mut self, val: u32) -> u32
appends the 4 bytes of val to the buffer. returns the offset (index) where those bytes were written.
Sourcepub fn write_string(&mut self, val: &str) -> u32
pub fn write_string(&mut self, val: &str) -> u32
first, append a 4-byte length (u32). then, append the raw string bytes. crucial: append padding zeros until the buffer’s total size is a multiple of 4 bytes. returns the offset where the length was written.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZonWriter
impl RefUnwindSafe for ZonWriter
impl Send for ZonWriter
impl Sync for ZonWriter
impl Unpin for ZonWriter
impl UnwindSafe for ZonWriter
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