pub struct Builder { /* private fields */ }Expand description
Use this struct to create a new Connection.
All the 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 max_field_section_size for the Builder.
See Header size for more information.
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,
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 UnsafeUnpin 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