pub struct Writer { /* private fields */ }Expand description
Section bytes being built, and the string table they intern into.
Implementations§
Source§impl Writer
impl Writer
pub fn new() -> Self
pub fn byte(&mut self, byte: u8)
pub fn bytes(&mut self, bytes: &[u8])
pub fn leb(&mut self, value: u64)
pub fn zigzag(&mut self, value: i64)
pub fn count(&mut self, count: usize)
Sourcepub fn string(&mut self, text: &str)
pub fn string(&mut self, text: &str)
Writes the string’s index in the table, adding it on first use.
Sourcepub fn take(&mut self) -> Vec<u8> ⓘ
pub fn take(&mut self) -> Vec<u8> ⓘ
The bytes written since the last take. The string table carries on.
pub fn strings(&self) -> &StringTable
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnsafeUnpin 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