Skip to main content

QuicInitialPacketBuilder

Struct QuicInitialPacketBuilder 

Source
pub struct QuicInitialPacketBuilder<'buffer, 'input> { /* private fields */ }
Expand description

Builds a protected QUIC v1 or v2 Initial packet in caller-owned storage.

Implementations§

Source§

impl<'buffer, 'input> QuicInitialPacketBuilder<'buffer, 'input>

Source

pub fn new( destination: &'buffer mut [u8], version: QuicVersion, protected_low_bits: u8, destination_connection_id: QuicConnectionId<'input>, source_connection_id: QuicConnectionId<'input>, token: &'input [u8], protected_remainder: &'input [u8], ) -> Self

Creates a builder with exact opaque Initial token and protected-remainder bytes.

Source

pub fn with_token_length_len(self, length: QuicVarIntLen) -> Self

Requests an explicit legal encoded width for the Initial token-length field.

Source

pub fn with_length_len(self, length: QuicVarIntLen) -> Self

Requests an explicit legal encoded width for the protected packet-length field.

Source

pub fn build( self, ) -> Result<QuicProtectedLongPacket<'buffer>, QuicPacketBuildError>

Validates all inputs and capacity before writing a complete protected Initial packet.

Auto Trait Implementations§

§

impl<'buffer, 'input> !UnwindSafe for QuicInitialPacketBuilder<'buffer, 'input>

§

impl<'buffer, 'input> Freeze for QuicInitialPacketBuilder<'buffer, 'input>

§

impl<'buffer, 'input> RefUnwindSafe for QuicInitialPacketBuilder<'buffer, 'input>

§

impl<'buffer, 'input> Send for QuicInitialPacketBuilder<'buffer, 'input>

§

impl<'buffer, 'input> Sync for QuicInitialPacketBuilder<'buffer, 'input>

§

impl<'buffer, 'input> Unpin for QuicInitialPacketBuilder<'buffer, 'input>

§

impl<'buffer, 'input> UnsafeUnpin for QuicInitialPacketBuilder<'buffer, 'input>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.