pub struct Writer { /* private fields */ }Expand description
Writer for encoding values to a byte buffer.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn write_bool(&mut self, value: bool) -> Result<()>
pub fn write_bool(&mut self, value: bool) -> Result<()>
Write a boolean (encoded as u8: 0 = false, 1 = true).
Sourcepub fn write_bytes(&mut self, bytes: &[u8]) -> Result<()>
pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<()>
Write a byte slice.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume the writer and return the encoded bytes.
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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