pub struct VarInt(/* private fields */);
Expand description
An integer less than 2^62
Values of this type are suitable for encoding as QUIC variable-length integer.
Implementations§
Source§impl VarInt
impl VarInt
Sourcepub const unsafe fn from_u64_unchecked(x: u64) -> VarInt
pub const unsafe fn from_u64_unchecked(x: u64) -> VarInt
Sourcepub const fn into_inner(self) -> u64
pub const fn into_inner(self) -> u64
Extract the integer value
Sourcepub fn saturating_add(self, rhs: impl Into<VarInt>) -> VarInt
pub fn saturating_add(self, rhs: impl Into<VarInt>) -> VarInt
Saturating integer addition. Computes self + rhs, saturating at the numeric bounds instead of overflowing.
Trait Implementations§
Source§impl From<VarInt> for IdleTimeout
impl From<VarInt> for IdleTimeout
Source§fn from(inner: VarInt) -> IdleTimeout
fn from(inner: VarInt) -> IdleTimeout
Converts to this type from the input type.
Source§impl Ord for VarInt
impl Ord for VarInt
Source§impl PartialOrd for VarInt
impl PartialOrd for VarInt
impl Copy for VarInt
impl Eq for VarInt
impl StructuralPartialEq for VarInt
Auto Trait Implementations§
impl Freeze for VarInt
impl RefUnwindSafe for VarInt
impl Send for VarInt
impl Sync for VarInt
impl Unpin for VarInt
impl UnwindSafe for VarInt
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
)