Struct quinn_proto::VarInt
source · [−]pub struct VarInt(_);Expand description
An integer less than 2^62
Values of this type are suitable for encoding as QUIC variable-length integer.
Implementations
sourceimpl 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
sourceimpl<'arbitrary> Arbitrary<'arbitrary> for VarInt
impl<'arbitrary> Arbitrary<'arbitrary> for VarInt
sourcefn 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 moresourcefn 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 moresourceimpl From<VarInt> for IdleTimeout
impl From<VarInt> for IdleTimeout
sourceimpl Ord for VarInt
impl Ord for VarInt
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<VarInt> for VarInt
impl PartialOrd<VarInt> for VarInt
sourcefn partial_cmp(&self, other: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, other: &VarInt) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moresourceimpl TryFrom<u128> for VarInt
impl TryFrom<u128> for VarInt
sourcefn try_from(x: u128) -> Result<Self, VarIntBoundsExceeded>
fn try_from(x: u128) -> Result<Self, VarIntBoundsExceeded>
Succeeds iff x < 2^62
type Error = VarIntBoundsExceeded
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
sourceimpl TryFrom<u64> for VarInt
impl TryFrom<u64> for VarInt
sourcefn try_from(x: u64) -> Result<Self, VarIntBoundsExceeded>
fn try_from(x: u64) -> Result<Self, VarIntBoundsExceeded>
Succeeds iff x < 2^62
type Error = VarIntBoundsExceeded
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
sourceimpl TryFrom<usize> for VarInt
impl TryFrom<usize> for VarInt
sourcefn try_from(x: usize) -> Result<Self, VarIntBoundsExceeded>
fn try_from(x: usize) -> Result<Self, VarIntBoundsExceeded>
Succeeds iff x < 2^62
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more