[][src]Struct quinn::VarInt

pub struct VarInt(_);

An integer less than 2^62

Values of this type are suitable for encoding as QUIC variable-length integer.

Methods

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]

Create a VarInt without ensuring it's in range

Safety

x must be less than 2^62.

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<u16> for VarInt[src]

impl From<u32> for VarInt[src]

impl From<u8> for VarInt[src]

impl Hash for VarInt[src]

impl Ord for VarInt[src]

impl PartialEq<VarInt> for VarInt[src]

impl PartialOrd<VarInt> for VarInt[src]

impl StructuralEq for VarInt[src]

impl StructuralPartialEq for VarInt[src]

impl TryFrom<u64> for VarInt[src]

type Error = VarIntBoundsExceeded

The type returned in the event of a conversion error.

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.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,