Struct Builder

Source
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

Source

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.

Source

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.

Source

pub fn enable_datagram(&mut self, enabled: bool) -> &mut Builder

Indicates that the client supports HTTP/3 datagrams

See: https://www.rfc-editor.org/rfc/rfc9297#section-2.1.1

Source

pub fn enable_extended_connect(&mut self, value: bool) -> &mut Builder

Enables the extended CONNECT protocol required for various HTTP/3 extensions.

Source

pub async fn build<C, O, B>( &mut self, quic: C, ) -> Result<(Connection<C, B>, SendRequest<O, B>), ConnectionError>
where C: Connection<B, OpenStreams = O>, O: OpenStreams<B>, B: Buf,

Create a new HTTP/3 client from a quic connection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more