Enum quinn_proto::ProtectedHeader
source · pub enum ProtectedHeader {
Initial(ProtectedInitialHeader),
Long {
ty: LongType,
dst_cid: ConnectionId,
src_cid: ConnectionId,
len: u64,
version: u32,
},
Retry {
dst_cid: ConnectionId,
src_cid: ConnectionId,
version: u32,
},
Short {
spin: bool,
dst_cid: ConnectionId,
},
VersionNegotiate {
random: u8,
dst_cid: ConnectionId,
src_cid: ConnectionId,
},
}
Expand description
Plain packet header
Variants§
Initial(ProtectedInitialHeader)
An Initial packet header
Long
A Long packet header, as used during the handshake
Retry
A Retry packet header
Short
A short packet header, as used during the data phase
VersionNegotiate
A Version Negotiation packet header
Implementations§
source§impl ProtectedHeader
impl ProtectedHeader
sourcepub fn dst_cid(&self) -> &ConnectionId
pub fn dst_cid(&self) -> &ConnectionId
The destination Connection ID of the packet
sourcepub fn decode(
buf: &mut Cursor<BytesMut>,
cid_parser: &(impl ConnectionIdParser + ?Sized),
supported_versions: &[u32],
grease_quic_bit: bool,
) -> Result<Self, PacketDecodeError>
pub fn decode( buf: &mut Cursor<BytesMut>, cid_parser: &(impl ConnectionIdParser + ?Sized), supported_versions: &[u32], grease_quic_bit: bool, ) -> Result<Self, PacketDecodeError>
Decode a plain header from given buffer, with given ConnectionIdParser
.
Trait Implementations§
source§impl Clone for ProtectedHeader
impl Clone for ProtectedHeader
source§fn clone(&self) -> ProtectedHeader
fn clone(&self) -> ProtectedHeader
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 moreAuto Trait Implementations§
impl Freeze for ProtectedHeader
impl RefUnwindSafe for ProtectedHeader
impl Send for ProtectedHeader
impl Sync for ProtectedHeader
impl Unpin for ProtectedHeader
impl UnwindSafe for ProtectedHeader
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)