pub struct QuicBuilder { /* private fields */ }Expand description
Builder for QUIC packets.
Supports Initial, Handshake (long header) and 1-RTT (short header) packet construction.
§Example
use stackforge_core::layer::quic::builder::QuicBuilder;
let bytes = QuicBuilder::initial()
.dst_conn_id(vec![0x01, 0x02, 0x03, 0x04])
.src_conn_id(vec![0xAA, 0xBB])
.payload(vec![0xDE, 0xAD, 0xBE, 0xEF])
.build();Implementations§
Source§impl QuicBuilder
impl QuicBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a bare builder. Most callers should use [initial], [handshake],
or [one_rtt] instead.
Sourcepub fn initial() -> Self
pub fn initial() -> Self
Create a builder pre-configured for a QUIC Initial packet (RFC 9000 Section 17.2.2).
Sourcepub fn handshake() -> Self
pub fn handshake() -> Self
Create a builder pre-configured for a QUIC Handshake packet (RFC 9000 Section 17.2.4).
Sourcepub fn one_rtt() -> Self
pub fn one_rtt() -> Self
Create a builder pre-configured for a QUIC 1-RTT (short header) packet (RFC 9000 Section 17.3).
Sourcepub fn dst_conn_id(self, id: Vec<u8>) -> Self
pub fn dst_conn_id(self, id: Vec<u8>) -> Self
Set the destination connection ID.
Sourcepub fn src_conn_id(self, id: Vec<u8>) -> Self
pub fn src_conn_id(self, id: Vec<u8>) -> Self
Set the source connection ID (ignored for short-header packets).
Sourcepub fn packet_number(self, n: u32) -> Self
pub fn packet_number(self, n: u32) -> Self
Set the packet number.
Trait Implementations§
Source§impl Clone for QuicBuilder
impl Clone for QuicBuilder
Source§fn clone(&self) -> QuicBuilder
fn clone(&self) -> QuicBuilder
Returns a duplicate 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 QuicBuilder
impl Debug for QuicBuilder
Auto Trait Implementations§
impl Freeze for QuicBuilder
impl RefUnwindSafe for QuicBuilder
impl Send for QuicBuilder
impl Sync for QuicBuilder
impl Unpin for QuicBuilder
impl UnsafeUnpin for QuicBuilder
impl UnwindSafe for QuicBuilder
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