pub struct QuicVarIntBuilder<'a> { /* private fields */ }Expand description
Builds a QUIC variable-length integer in caller-owned storage.
Implementations§
Source§impl<'a> QuicVarIntBuilder<'a>
impl<'a> QuicVarIntBuilder<'a>
Sourcepub fn new(destination: &'a mut [u8], value: u64) -> Self
pub fn new(destination: &'a mut [u8], value: u64) -> Self
Creates a builder that emits the value with its canonical shortest width.
Sourcepub fn with_len(self, length: QuicVarIntLen) -> Self
pub fn with_len(self, length: QuicVarIntLen) -> Self
Requests an explicit legal encoded width, including a non-canonical width.
Sourcepub fn build(self) -> Result<QuicVarInt<'a>, QuicVarIntBuildError>
pub fn build(self) -> Result<QuicVarInt<'a>, QuicVarIntBuildError>
Validates the value, requested width, and capacity before mutating the destination.
Auto Trait Implementations§
impl<'a> !UnwindSafe for QuicVarIntBuilder<'a>
impl<'a> Freeze for QuicVarIntBuilder<'a>
impl<'a> RefUnwindSafe for QuicVarIntBuilder<'a>
impl<'a> Send for QuicVarIntBuilder<'a>
impl<'a> Sync for QuicVarIntBuilder<'a>
impl<'a> Unpin for QuicVarIntBuilder<'a>
impl<'a> UnsafeUnpin for QuicVarIntBuilder<'a>
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