pub struct ByteBuilder<T> { /* private fields */ }
Expand description
A dynamically created buffer for T
Implementations§
source§impl<T> ByteBuilder<T>
impl<T> ByteBuilder<T>
sourcepub fn new_fixed(size: NonZeroUsize) -> Self
pub fn new_fixed(size: NonZeroUsize) -> Self
Create a builder of fixed size
sourcepub fn iter8<F, I>(self, l: I, f: F) -> Self
pub fn iter8<F, I>(self, l: I, f: F) -> Self
write an iterator of maximum 256 items using the closure F
note that the buffer contains a byte to represent the size of the list
sourcepub fn iter16<F, I>(self, l: I, f: F) -> Self
pub fn iter16<F, I>(self, l: I, f: F) -> Self
write an iterator of maximum 2^16 items using the closure F
note that the buffer contains 2 bytes to represent the size of the list
pub fn sub<F, U>(self, f: F) -> Self
sourcepub fn finalize_as_vec(self) -> Vec<u8> ⓘ
pub fn finalize_as_vec(self) -> Vec<u8> ⓘ
Finalize the buffer and return a fixed ByteArray of T
Trait Implementations§
source§impl<T: Clone> Clone for ByteBuilder<T>
impl<T: Clone> Clone for ByteBuilder<T>
source§fn clone(&self) -> ByteBuilder<T>
fn clone(&self) -> ByteBuilder<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for ByteBuilder<T>
impl<T> RefUnwindSafe for ByteBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for ByteBuilder<T>where
T: Send,
impl<T> Sync for ByteBuilder<T>where
T: Sync,
impl<T> Unpin for ByteBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for ByteBuilder<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)