pub struct FieldWriter { /* private fields */ }Expand description
Builds a tagged-field payload.
Implementations§
Source§impl FieldWriter
impl FieldWriter
pub fn new() -> Self
pub fn into_vec(self) -> Vec<u8> ⓘ
Sourcepub fn put_u64(&mut self, tag: u16, v: u64)
pub fn put_u64(&mut self, tag: u16, v: u64)
Writes an 8-byte integer field. Always written, even when zero — decoders rely on the tag being present for bool-ish fields.
pub fn put_u16(&mut self, tag: u16, v: u16)
pub fn put_u32(&mut self, tag: u16, v: u32)
pub fn put_bool(&mut self, tag: u16, v: bool)
Sourcepub fn put_bytes(&mut self, tag: u16, p: &[u8])
pub fn put_bytes(&mut self, tag: u16, p: &[u8])
Writes a length-prefixed blob. Empty blobs are omitted so decoders stay compact on the hot path.
pub fn put_string(&mut self, tag: u16, s: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FieldWriter
impl RefUnwindSafe for FieldWriter
impl Send for FieldWriter
impl Sync for FieldWriter
impl Unpin for FieldWriter
impl UnsafeUnpin for FieldWriter
impl UnwindSafe for FieldWriter
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