Struct quinn_proto::VarInt [−][src]
pub struct VarInt(_);
An integer less than 2^62
Values of this type are suitable for encoding as QUIC variable-length integer.
Implementations
impl VarInt
[src]
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) -> Self
[src]
Construct a VarInt
infallibly
pub fn from_u64(x: u64) -> Result<Self, VarIntBoundsExceeded>
[src]
Succeeds iff x
< 2^62
pub const unsafe fn from_u64_unchecked(x: u64) -> Self
[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 PartialOrd<VarInt> for VarInt
[src]
impl PartialOrd<VarInt> for VarInt
[src]impl StructuralEq for VarInt
[src]
impl StructuralEq for VarInt
[src]impl StructuralPartialEq for VarInt
[src]
impl StructuralPartialEq for VarInt
[src]impl TryFrom<u128> for VarInt
[src]
impl TryFrom<u128> for VarInt
[src]type Error = VarIntBoundsExceeded
The type returned in the event of a conversion error.
fn try_from(x: u128) -> Result<Self, VarIntBoundsExceeded>
[src]
Succeeds iff x
< 2^62
Auto Trait Implementations
impl RefUnwindSafe for VarInt
impl RefUnwindSafe for VarInt
impl UnwindSafe for VarInt
impl UnwindSafe for VarInt
Blanket Implementations
impl<T> Instrument 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<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,