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
sourcepub fn encoded_size(first: u8) -> usize
pub fn encoded_size(first: u8) -> usize
Length of an encoded value from its first byte
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 more
sourcefn 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 more
sourceimpl From<VarInt> for IdleTimeout
impl From<VarInt> for IdleTimeout
sourceimpl Ord for VarInt
impl Ord for VarInt
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: 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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more