Struct quinn_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 iff 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<'arbitrary> Arbitrary<'arbitrary> for VarInt
impl<'arbitrary> Arbitrary<'arbitrary> for VarInt
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moresource§impl From<VarInt> for IdleTimeout
impl From<VarInt> for IdleTimeout
source§impl Ord for VarInt
impl Ord for VarInt
source§impl PartialEq for VarInt
impl PartialEq for VarInt
source§impl PartialOrd for VarInt
impl PartialOrd for VarInt
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<u128> for VarInt
impl TryFrom<u128> for VarInt
§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
§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
§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 StructuralEq for VarInt
impl StructuralPartialEq for VarInt
Auto Trait Implementations§
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