pub struct Builder { /* private fields */ }Available on crate feature
h3 only.Expand description
HTTP/3 client builder
Set the configuration for a new client.
§Examples
let h3_conn = h3::client::builder()
.max_field_section_size(8192)
.build(quic)
.await
.expect("Failed to build connection");Implementations§
Source§impl Builder
impl Builder
Sourcepub fn max_field_section_size(&mut self, value: u64) -> &mut Builder
pub fn max_field_section_size(&mut self, value: u64) -> &mut Builder
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, enabled: bool) -> &mut Builder
pub fn send_grease(&mut self, enabled: bool) -> &mut Builder
Just like in HTTP/2, HTTP/3 also uses the concept of “grease” to prevent potential interoperability issues in the future. In HTTP/3, the concept of grease is used to ensure that the protocol can evolve and accommodate future changes without breaking existing implementations.
Sourcepub fn enable_datagram(&mut self, enabled: bool) -> &mut Builder
pub fn enable_datagram(&mut self, enabled: bool) -> &mut Builder
Indicates that the client supports HTTP/3 datagrams
Sourcepub fn enable_extended_connect(&mut self, value: bool) -> &mut Builder
pub fn enable_extended_connect(&mut self, value: bool) -> &mut Builder
Enables the extended CONNECT protocol required for various HTTP/3 extensions.
Sourcepub async fn build<C, O, B>(
&mut self,
quic: C,
) -> Result<(Connection<C, B>, SendRequest<O, B>), ConnectionError>
pub async fn build<C, O, B>( &mut self, quic: C, ) -> Result<(Connection<C, B>, SendRequest<O, B>), ConnectionError>
Create a new HTTP/3 client from a quic connection
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more