pub struct Builder { /* private fields */ }Expand description
Builder of HTTP/3 server connections.
Use this struct to create a new Connection.
Settings for the Connection can be provided here.
§Example
fn doc<C,B>(conn: C)
where
C: sec_http3::quic::Connection<B>,
B: bytes::Buf,
{
let mut server_builder = sec_http3::server::builder();
// Set the maximum header size
server_builder.max_field_section_size(1000);
// do not send grease types
server_builder.send_grease(false);
// Build the Connection
let mut h3_conn = server_builder.build(conn);
}Implementations§
Source§impl Builder
impl Builder
Sourcepub fn max_field_section_size(&mut self, value: u64) -> &mut Self
pub fn max_field_section_size(&mut self, value: u64) -> &mut Self
Set the maximum header size this client is willing to accept
See header size constraints section of the specification for details.
Sourcepub fn send_grease(&mut self, value: bool) -> &mut Self
pub fn send_grease(&mut self, value: bool) -> &mut Self
Sourcepub fn enable_webtransport(&mut self, value: bool) -> &mut Self
pub fn enable_webtransport(&mut self, value: bool) -> &mut Self
Indicates to the peer that WebTransport is supported.
See: establishing a webtransport session
Server:
Supporting for webtransport also requires setting enable_connect enable_datagram
and max_webtransport_sessions.
Sourcepub fn enable_connect(&mut self, value: bool) -> &mut Self
pub fn enable_connect(&mut self, value: bool) -> &mut Self
Enables the CONNECT protocol
Sourcepub fn max_webtransport_sessions(&mut self, value: u64) -> &mut Self
pub fn max_webtransport_sessions(&mut self, value: u64) -> &mut Self
Limits the maximum number of WebTransport sessions
Sourcepub fn enable_datagram(&mut self, value: bool) -> &mut Self
pub fn enable_datagram(&mut self, value: bool) -> &mut Self
Indicates that the client or server supports HTTP/3 datagrams
Source§impl Builder
impl Builder
Sourcepub async fn build<C, B>(&self, conn: C) -> Result<Connection<C, B>, Error>where
C: Connection<B>,
B: Buf,
pub async fn build<C, B>(&self, conn: C) -> Result<Connection<C, B>, Error>where
C: Connection<B>,
B: Buf,
Build an HTTP/3 connection from a QUIC connection
This method creates a Connection instance with the settings in the Builder.
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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