Struct quinn::VarInt [−][src]
An integer less than 2^62
Values of this type are suitable for encoding as QUIC variable-length integer.
Implementations
impl VarInt
[src]
pub const MAX: VarInt
[src]
The largest representable value
pub const MAX_SIZE: usize
[src]
The largest encoded value length
pub const fn from_u32(x: u32) -> VarInt
[src]
Construct a VarInt
infallibly
pub fn from_u64(x: u64) -> Result<VarInt, VarIntBoundsExceeded>
[src]
Succeeds iff x
< 2^62
pub const unsafe fn from_u64_unchecked(x: u64) -> VarInt
[src]
pub const fn into_inner(self) -> u64
[src]
Extract the integer value
pub fn size(self) -> usize
[src]
Compute the number of bytes needed to encode this value
pub fn encoded_size(first: u8) -> usize
[src]
Length of an encoded value from its first byte
Trait Implementations
impl Clone for VarInt
[src]
impl Copy for VarInt
[src]
impl Debug for VarInt
[src]
impl Default for VarInt
[src]
impl Display for VarInt
[src]
impl Eq for VarInt
[src]
impl From<VarInt> for StreamId
[src]
impl From<u16> for VarInt
[src]
impl From<u32> for VarInt
[src]
impl From<u8> for VarInt
[src]
impl Hash for VarInt
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<VarInt> for StreamId
[src]
impl Ord for VarInt
[src]
pub fn cmp(&self, other: &VarInt) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<VarInt> for VarInt
[src]
impl PartialOrd<VarInt> for VarInt
[src]
pub fn partial_cmp(&self, other: &VarInt) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for VarInt
[src]
impl StructuralPartialEq for VarInt
[src]
impl TryFrom<u128> for VarInt
[src]
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
pub fn try_from(x: u128) -> Result<VarInt, VarIntBoundsExceeded>
[src]
Succeeds iff x
< 2^62
impl TryFrom<u64> for VarInt
[src]
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
pub fn try_from(x: u64) -> Result<VarInt, VarIntBoundsExceeded>
[src]
Succeeds iff x
< 2^62
impl TryFrom<usize> for VarInt
[src]
type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
pub fn try_from(x: usize) -> Result<VarInt, VarIntBoundsExceeded>
[src]
Succeeds iff x
< 2^62
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,