Struct s2n_quic_core::varint::VarInt
source · [−]pub struct VarInt(_);Implementations
sourceimpl VarInt
impl VarInt
pub const MAX: Self = Self(MAX_VARINT_VALUE)
pub fn new(v: u64) -> Result<Self, VarIntError>
sourcepub const unsafe fn new_unchecked(value: u64) -> Self
pub const unsafe fn new_unchecked(value: u64) -> Self
Returns a VarInt without validating the value is less than VarInt::MAX
Safety
Callers need to ensure the value is less than or equal to VarInt::MAX
pub const fn from_u8(v: u8) -> Self
pub const fn from_u16(v: u16) -> Self
pub const fn from_u32(v: u32) -> Self
pub const fn as_u64(self) -> u64
pub fn checked_add(self, value: Self) -> Option<Self>
pub fn checked_add_usize(self, value: usize) -> Option<Self>
pub fn saturating_add(self, value: Self) -> Self
pub fn checked_sub(self, value: Self) -> Option<Self>
pub fn saturating_sub(self, value: Self) -> Self
pub fn checked_mul(self, value: Self) -> Option<Self>
pub fn saturating_mul(self, value: Self) -> Self
pub fn checked_div(self, value: Self) -> Option<Self>
sourcepub fn encode_updated<E: Encoder>(self, replacement: Self, encoder: &mut E)
pub fn encode_updated<E: Encoder>(self, replacement: Self, encoder: &mut E)
Re-encodes a replacement value where self was used as a placeholder.
Methods from Deref<Target = u64>
Trait Implementations
sourceimpl AddAssign<VarInt> for VarInt
impl AddAssign<VarInt> for VarInt
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the += operation. Read more
sourceimpl AddAssign<usize> for VarInt
impl AddAssign<usize> for VarInt
sourcefn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the += operation. Read more
sourceimpl<'a> DecoderValue<'a> for VarInt
impl<'a> DecoderValue<'a> for VarInt
fn decode(buffer: DecoderBuffer<'a>) -> DecoderBufferResult<'a, Self>
sourceimpl<'a> DecoderValueMut<'a> for VarInt
impl<'a> DecoderValueMut<'a> for VarInt
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'a, Self>
sourceimpl DivAssign<VarInt> for VarInt
impl DivAssign<VarInt> for VarInt
sourcefn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the /= operation. Read more
sourceimpl DivAssign<usize> for VarInt
impl DivAssign<usize> for VarInt
sourcefn div_assign(&mut self, rhs: usize)
fn div_assign(&mut self, rhs: usize)
Performs the /= operation. Read more
sourceimpl EncoderValue for VarInt
impl EncoderValue for VarInt
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl MulAssign<VarInt> for VarInt
impl MulAssign<VarInt> for VarInt
sourcefn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the *= operation. Read more
sourceimpl MulAssign<usize> for VarInt
impl MulAssign<usize> for VarInt
sourcefn mul_assign(&mut self, rhs: usize)
fn mul_assign(&mut self, rhs: usize)
Performs the *= operation. Read more
sourceimpl Ord for VarInt
impl Ord for VarInt
sourceimpl PartialEq<VarInt> for MaxIdleTimeout
impl PartialEq<VarInt> for MaxIdleTimeout
sourceimpl PartialEq<VarInt> for MaxUdpPayloadSize
impl PartialEq<VarInt> for MaxUdpPayloadSize
sourceimpl PartialEq<VarInt> for ActiveConnectionIdLimit
impl PartialEq<VarInt> for ActiveConnectionIdLimit
sourceimpl PartialEq<VarInt> for InitialMaxData
impl PartialEq<VarInt> for InitialMaxData
sourceimpl PartialEq<VarInt> for InitialMaxStreamDataUni
impl PartialEq<VarInt> for InitialMaxStreamDataUni
sourceimpl PartialEq<VarInt> for InitialMaxStreamsBidi
impl PartialEq<VarInt> for InitialMaxStreamsBidi
sourceimpl PartialEq<VarInt> for InitialMaxStreamsUni
impl PartialEq<VarInt> for InitialMaxStreamsUni
sourceimpl PartialEq<VarInt> for MaxDatagramFrameSize
impl PartialEq<VarInt> for MaxDatagramFrameSize
sourceimpl PartialEq<VarInt> for MaxAckDelay
impl PartialEq<VarInt> for MaxAckDelay
sourceimpl PartialOrd<VarInt> for MaxIdleTimeout
impl PartialOrd<VarInt> for MaxIdleTimeout
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for MaxUdpPayloadSize
impl PartialOrd<VarInt> for MaxUdpPayloadSize
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for ActiveConnectionIdLimit
impl PartialOrd<VarInt> for ActiveConnectionIdLimit
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 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 PartialOrd<VarInt> for InitialMaxData
impl PartialOrd<VarInt> for InitialMaxData
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for InitialMaxStreamDataBidiLocal
impl PartialOrd<VarInt> for InitialMaxStreamDataBidiLocal
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for InitialMaxStreamDataBidiRemote
impl PartialOrd<VarInt> for InitialMaxStreamDataBidiRemote
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for InitialMaxStreamDataUni
impl PartialOrd<VarInt> for InitialMaxStreamDataUni
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for InitialMaxStreamsBidi
impl PartialOrd<VarInt> for InitialMaxStreamsBidi
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for InitialMaxStreamsUni
impl PartialOrd<VarInt> for InitialMaxStreamsUni
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for MaxDatagramFrameSize
impl PartialOrd<VarInt> for MaxDatagramFrameSize
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<VarInt> for MaxAckDelay
impl PartialOrd<VarInt> for MaxAckDelay
sourcefn partial_cmp(&self, value: &VarInt) -> Option<Ordering>
fn partial_cmp(&self, value: &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 PartialOrd<u64> for VarInt
impl PartialOrd<u64> for VarInt
sourcefn partial_cmp(&self, other: &u64) -> Option<Ordering>
fn partial_cmp(&self, other: &u64) -> 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 PartialOrd<usize> for VarInt
impl PartialOrd<usize> for VarInt
sourcefn partial_cmp(&self, other: &usize) -> Option<Ordering>
fn partial_cmp(&self, other: &usize) -> 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 RemAssign<VarInt> for VarInt
impl RemAssign<VarInt> for VarInt
sourcefn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the %= operation. Read more
sourceimpl RemAssign<usize> for VarInt
impl RemAssign<usize> for VarInt
sourcefn rem_assign(&mut self, rhs: usize)
fn rem_assign(&mut self, rhs: usize)
Performs the %= operation. Read more
sourceimpl SubAssign<VarInt> for VarInt
impl SubAssign<VarInt> for VarInt
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -= operation. Read more
sourceimpl SubAssign<usize> for VarInt
impl SubAssign<usize> for VarInt
sourcefn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the -= operation. Read more
sourceimpl TryFrom<VarInt> for MaxIdleTimeout
impl TryFrom<VarInt> for MaxIdleTimeout
sourceimpl TryFrom<VarInt> for MaxUdpPayloadSize
impl TryFrom<VarInt> for MaxUdpPayloadSize
sourceimpl TryFrom<VarInt> for ActiveConnectionIdLimit
impl TryFrom<VarInt> for ActiveConnectionIdLimit
sourceimpl TryFrom<VarInt> for InitialMaxData
impl TryFrom<VarInt> for InitialMaxData
sourceimpl TryFrom<VarInt> for InitialMaxStreamDataBidiLocal
impl TryFrom<VarInt> for InitialMaxStreamDataBidiLocal
sourceimpl TryFrom<VarInt> for InitialMaxStreamDataUni
impl TryFrom<VarInt> for InitialMaxStreamDataUni
sourceimpl TryFrom<VarInt> for InitialMaxStreamsBidi
impl TryFrom<VarInt> for InitialMaxStreamsBidi
sourceimpl TryFrom<VarInt> for InitialMaxStreamsUni
impl TryFrom<VarInt> for InitialMaxStreamsUni
sourceimpl TryFrom<VarInt> for MaxDatagramFrameSize
impl TryFrom<VarInt> for MaxDatagramFrameSize
sourceimpl TryFrom<VarInt> for MaxAckDelay
impl TryFrom<VarInt> for MaxAckDelay
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> PacketPayloadEncoder for T where
T: EncoderValue,
impl<T> PacketPayloadEncoder for T where
T: EncoderValue,
sourcefn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usize where
E: Encoder,
fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usize where
E: Encoder,
Returns an estimate of the encoding size of the payload. This may be inaccurate from what actually is encoded. Estimates should be less than or equal to what is actually written. Implementations can return 0 to skip encoding. Read more