pub struct PacketHeader {
pub packet_type: PacketType,
pub packet_number: Option<u64>,
pub flags: Option<u8>,
pub token: Option<Token>,
pub length: Option<u16>,
pub version: Option<Bytes>,
pub scil: Option<u8>,
pub dcil: Option<u8>,
pub scid: Option<Bytes>,
pub dcid: Option<Bytes>,
}
Fields§
§packet_type: PacketType
§packet_number: Option<u64>
§flags: Option<u8>
§token: Option<Token>
§length: Option<u16>
§version: Option<Bytes>
§scil: Option<u8>
§dcil: Option<u8>
§scid: Option<Bytes>
§dcid: Option<Bytes>
Implementations§
Source§impl PacketHeader
impl PacketHeader
Sourcepub fn new(
packet_type: PacketType,
packet_number: Option<u64>,
flags: Option<u8>,
token: Option<Token>,
length: Option<u16>,
version: Option<u32>,
scid: Option<&[u8]>,
dcid: Option<&[u8]>,
) -> Self
pub fn new( packet_type: PacketType, packet_number: Option<u64>, flags: Option<u8>, token: Option<Token>, length: Option<u16>, version: Option<u32>, scid: Option<&[u8]>, dcid: Option<&[u8]>, ) -> Self
Creates a new PacketHeader.
Sourcepub fn with_type(
ty: PacketType,
packet_number: Option<u64>,
version: Option<u32>,
scid: Option<&[u8]>,
dcid: Option<&[u8]>,
) -> Self
pub fn with_type( ty: PacketType, packet_number: Option<u64>, version: Option<u32>, scid: Option<&[u8]>, dcid: Option<&[u8]>, ) -> Self
Creates a new PacketHeader.
Once a QUIC connection has formed, version, dcid and scid are stable, so there are space benefits to not logging them in every packet, especially PacketType::OneRtt.
Trait Implementations§
Source§impl Clone for PacketHeader
impl Clone for PacketHeader
Source§fn clone(&self) -> PacketHeader
fn clone(&self) -> PacketHeader
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 Debug for PacketHeader
impl Debug for PacketHeader
Source§impl<'de> Deserialize<'de> for PacketHeader
impl<'de> Deserialize<'de> for PacketHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PacketHeader
impl PartialEq for PacketHeader
Source§impl Serialize for PacketHeader
impl Serialize for PacketHeader
impl Eq for PacketHeader
impl StructuralPartialEq for PacketHeader
Auto Trait Implementations§
impl Freeze for PacketHeader
impl RefUnwindSafe for PacketHeader
impl Send for PacketHeader
impl Sync for PacketHeader
impl Unpin for PacketHeader
impl UnwindSafe for PacketHeader
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.