pub struct BytesBuilder<'a, TBytes: BytesType> { /* private fields */ }Implementations§
Source§impl<'a, TBytes: BytesType> BytesBuilder<'a, TBytes>
impl<'a, TBytes: BytesType> BytesBuilder<'a, TBytes>
pub fn build( build: impl Fn(&mut BytesBuilder<'a, TBytes>), ) -> Result<TBytes, TryReserveError>
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Gets the current length of the builder.
On the first pass this will be the current calculated capacity and on the second pass it will be the current length of the bytes.
pub fn append(&mut self, value: impl BytesAppendable<'a> + 'a)
Sourcepub fn append_be<T: EndianBytesAppendable + 'a>(&mut self, value: T)
pub fn append_be<T: EndianBytesAppendable + 'a>(&mut self, value: T)
Appends a number in big-endian byte order.
WARNING: Rust defaults to i32 for integer literals. It’s probably best to always specify the type of number.
Sourcepub fn append_le<T: EndianBytesAppendable + 'a>(&mut self, value: T)
pub fn append_le<T: EndianBytesAppendable + 'a>(&mut self, value: T)
Appends a number in little-endian byte order.
WARNING: Rust defaults to i32 for integer literals. It’s probably best to always specify the type of number.
Auto Trait Implementations§
impl<'a, TBytes> Freeze for BytesBuilder<'a, TBytes>
impl<'a, TBytes> RefUnwindSafe for BytesBuilder<'a, TBytes>
impl<'a, TBytes> Send for BytesBuilder<'a, TBytes>
impl<'a, TBytes> Sync for BytesBuilder<'a, TBytes>
impl<'a, TBytes> Unpin for BytesBuilder<'a, TBytes>
impl<'a, TBytes> !UnwindSafe for BytesBuilder<'a, TBytes>
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