pub struct Writer { /* private fields */ }Expand description
A growable little-endian output buffer.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
An empty writer with capacity bytes preallocated.
Sourcepub fn pad_to(&mut self, align: usize)
pub fn pad_to(&mut self, align: usize)
Pad with zero bytes until the length is a multiple of align.
Sourcepub fn patch_u32(&mut self, at: usize, v: u32)
pub fn patch_u32(&mut self, at: usize, v: u32)
Overwrite the u32 at at.
Used for back-patching offsets once a layout is known.
Sourcepub fn patch_bytes(&mut self, at: usize, v: &[u8])
pub fn patch_bytes(&mut self, at: usize, v: &[u8])
Overwrite the bytes at at with v.
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