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: h3::quic::Connection<B>,
B: bytes::Buf,
{
let mut server_builder = h3::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 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