pub struct VersionNegotiation<'a, SupportedVersions> {
pub tag: u8,
pub destination_connection_id: &'a [u8],
pub source_connection_id: &'a [u8],
pub supported_versions: SupportedVersions,
}
Fields§
§tag: u8
§destination_connection_id: &'a [u8]
§source_connection_id: &'a [u8]
§supported_versions: SupportedVersions
Implementations§
source§impl<'a> VersionNegotiation<'a, &'a [u8]>
impl<'a> VersionNegotiation<'a, &'a [u8]>
pub fn decode( tag: u8, _version: u32, buffer: DecoderBufferMut<'_> ) -> DecoderBufferMutResult<'_, VersionNegotiation<'_, &[u8]>>
pub fn iter(&'a self) -> VersionNegotiationIterator<'a> ⓘ
pub fn destination_connection_id(&self) -> &[u8] ⓘ
pub fn source_connection_id(&self) -> &[u8] ⓘ
source§impl<'a, SupportedVersions: EncoderValue> VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: EncoderValue> VersionNegotiation<'a, SupportedVersions>
pub fn from_initial( initial_packet: &'a ProtectedInitial<'_>, supported_versions: SupportedVersions ) -> Self
Trait Implementations§
source§impl<'a, SupportedVersions: Clone> Clone for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: Clone> Clone for VersionNegotiation<'a, SupportedVersions>
source§fn clone(&self) -> VersionNegotiation<'a, SupportedVersions>
fn clone(&self) -> VersionNegotiation<'a, SupportedVersions>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, SupportedVersions: Debug> Debug for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: Debug> Debug for VersionNegotiation<'a, SupportedVersions>
source§impl<'a, SupportedVersions: EncoderValue> EncoderValue for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: EncoderValue> EncoderValue for VersionNegotiation<'a, SupportedVersions>
source§fn 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
source§fn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
source§fn encoding_size_for_encoder<E>(&self, encoder: &E) -> usizewhere
E: Encoder,
fn encoding_size_for_encoder<E>(&self, encoder: &E) -> usizewhere
E: Encoder,
Returns the encoding size for the given encoder’s capacity
source§fn encode_with_len_prefix<Len, E>(&self, encoder: &mut E)
fn encode_with_len_prefix<Len, E>(&self, encoder: &mut E)
Encodes the value into the encoder with a prefix of
Len
fn encode_to_vec(&self) -> Vec<u8>
source§impl<'a, SupportedVersions: Hash> Hash for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: Hash> Hash for VersionNegotiation<'a, SupportedVersions>
source§impl<'a, SupportedVersions: Ord> Ord for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: Ord> Ord for VersionNegotiation<'a, SupportedVersions>
source§fn cmp(&self, other: &VersionNegotiation<'a, SupportedVersions>) -> Ordering
fn cmp(&self, other: &VersionNegotiation<'a, SupportedVersions>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a, SupportedVersions: PartialEq> PartialEq for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: PartialEq> PartialEq for VersionNegotiation<'a, SupportedVersions>
source§fn eq(&self, other: &VersionNegotiation<'a, SupportedVersions>) -> bool
fn eq(&self, other: &VersionNegotiation<'a, SupportedVersions>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a, SupportedVersions: PartialOrd> PartialOrd for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: PartialOrd> PartialOrd for VersionNegotiation<'a, SupportedVersions>
source§fn partial_cmp(
&self,
other: &VersionNegotiation<'a, SupportedVersions>
) -> Option<Ordering>
fn partial_cmp( &self, other: &VersionNegotiation<'a, SupportedVersions> ) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl<'a, SupportedVersions: Copy> Copy for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions: Eq> Eq for VersionNegotiation<'a, SupportedVersions>
impl<'a, SupportedVersions> StructuralPartialEq for VersionNegotiation<'a, SupportedVersions>
Auto Trait Implementations§
impl<'a, SupportedVersions> Freeze for VersionNegotiation<'a, SupportedVersions>where
SupportedVersions: Freeze,
impl<'a, SupportedVersions> RefUnwindSafe for VersionNegotiation<'a, SupportedVersions>where
SupportedVersions: RefUnwindSafe,
impl<'a, SupportedVersions> Send for VersionNegotiation<'a, SupportedVersions>where
SupportedVersions: Send,
impl<'a, SupportedVersions> Sync for VersionNegotiation<'a, SupportedVersions>where
SupportedVersions: Sync,
impl<'a, SupportedVersions> Unpin for VersionNegotiation<'a, SupportedVersions>where
SupportedVersions: Unpin,
impl<'a, SupportedVersions> UnwindSafe for VersionNegotiation<'a, SupportedVersions>where
SupportedVersions: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> PacketPayloadEncoder for Twhere
T: EncoderValue,
impl<T> PacketPayloadEncoder for Twhere
T: EncoderValue,
source§fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usizewhere
E: Encoder,
fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usizewhere
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.