Struct web_transport_proto::VarInt
source · 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 fn from_u64(x: u64) -> Result<Self, VarIntBoundsExceeded>
pub fn from_u64(x: u64) -> Result<Self, VarIntBoundsExceeded>
Succeeds if x
< 2^62
sourcepub const unsafe fn from_u64_unchecked(x: u64) -> Self
pub const unsafe fn from_u64_unchecked(x: u64) -> Self
sourcepub const fn into_inner(self) -> u64
pub const fn into_inner(self) -> u64
Extract the integer value
Trait Implementations§
source§impl Ord for VarInt
impl Ord for VarInt
source§impl PartialOrd for VarInt
impl PartialOrd for VarInt
source§impl TryFrom<u128> for VarInt
impl TryFrom<u128> for VarInt
source§type Error = VarIntBoundsExceeded
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
source§impl TryFrom<u64> for VarInt
impl TryFrom<u64> for VarInt
source§type Error = VarIntBoundsExceeded
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
source§impl TryFrom<usize> for VarInt
impl TryFrom<usize> for VarInt
source§type Error = VarIntBoundsExceeded
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
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
)