pub struct ZeroBuilder { /* private fields */ }Available on crate features
alloc and zero-copy only.Expand description
A builder for zero-copy structures.
Implementations§
Source§impl ZeroBuilder
impl ZeroBuilder
Sourcepub fn reserve_bytes(&mut self, size: usize, align: usize) -> usize
pub fn reserve_bytes(&mut self, size: usize, align: usize) -> usize
Reserves a specific number of bytes with alignment.
Sourcepub fn write<T: ZeroCopy>(&mut self, offset: usize, val: &T)
pub fn write<T: ZeroCopy>(&mut self, offset: usize, val: &T)
Writes a value to the specified offset.
Sourcepub fn push<T: ZeroCopy>(&mut self, val: &T) -> usize
pub fn push<T: ZeroCopy>(&mut self, val: &T) -> usize
Pushes a value onto the builder and returns its offset.
Sourcepub fn push_bytes(&mut self, bytes: &[u8], align: usize) -> usize
pub fn push_bytes(&mut self, bytes: &[u8], align: usize) -> usize
Pushes raw bytes onto the builder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZeroBuilder
impl RefUnwindSafe for ZeroBuilder
impl Send for ZeroBuilder
impl Sync for ZeroBuilder
impl Unpin for ZeroBuilder
impl UnsafeUnpin for ZeroBuilder
impl UnwindSafe for ZeroBuilder
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