[][src]Struct quiche::Header

pub struct Header {
    pub ty: Type,
    pub version: u32,
    pub dcid: Vec<u8>,
    pub scid: Vec<u8>,
    pub odcid: Option<Vec<u8>>,
    pub token: Option<Vec<u8>>,
    pub versions: Option<Vec<u32>>,
    // some fields omitted
}

A QUIC packet's header.

Fields

ty: Type

The type of the packet.

version: u32

The version of the packet.

dcid: Vec<u8>

The destination connection ID of the packet.

scid: Vec<u8>

The source connection ID of the packet.

odcid: Option<Vec<u8>>

The original destination connection ID. Only present in Retry packets.

token: Option<Vec<u8>>

The address verification token of the packet. Only present in Initial and Retry packets.

versions: Option<Vec<u32>>

The list of versions in the packet. Only present in VersionNegotiation packets.

Methods

impl Header[src]

pub fn from_slice(buf: &mut [u8], dcid_len: usize) -> Result<Header>[src]

Parses a QUIC packet header from the given buffer.

The dcid_len parameter is the length of the destination connection ID, required to parse short header packets.

Examples:

let (len, src) = socket.recv_from(&mut buf).unwrap();

let hdr = quiche::Header::from_slice(&mut buf[..len], LOCAL_CONN_ID_LEN)?;

Trait Implementations

impl Clone for Header[src]

impl Debug for Header[src]

impl PartialEq<Header> for Header[src]

impl StructuralPartialEq for Header[src]

Auto Trait Implementations

impl RefUnwindSafe for Header

impl Send for Header

impl Sync for Header

impl Unpin for Header

impl UnwindSafe for Header

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, 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.