Struct H3Driver

Source
pub struct H3Driver<H: DriverHooks> { /* private fields */ }
Expand description

A ready-made ApplicationOverQuic which can handle HTTP/3 and MASQUE. Depending on the DriverHooks in use, it powers either a client or a server.

Use the ClientH3Driver and ServerH3Driver aliases to access the respective driver types. The driver is passed into an I/O loop and communicates with the driver’s user (e.g., an HTTP client or a server) via its associated H3Controller. The controller allows the application to both listen for H3Events of note and send H3Commands into the I/O loop.

Implementations§

Source§

impl<H: DriverHooks> H3Driver<H>

Source

pub fn new(http3_settings: Http3Settings) -> (Self, H3Controller<H>)

Builds a new H3Driver and an associated H3Controller.

The driver should then be passed to InitialQuicConnection’s start method.

Trait Implementations§

Source§

impl<H: DriverHooks> ApplicationOverQuic for H3Driver<H>

Source§

fn process_reads(&mut self, qconn: &mut QuicheConnection) -> QuicResult<()>

Poll the underlying [quiche::h3::Connection] for [quiche::h3::Event]s and DATAGRAMs, delegating processing to Self::process_read_event.

If a DATAGRAM is found, it is sent to the receiver on its channel.

Source§

fn process_writes(&mut self, qconn: &mut QuicheConnection) -> QuicResult<()>

Write as much data as possible into the [quiche::h3::Connection] from all sources. This will attempt to write any queued frames into their respective streams, if writable.

Source§

fn on_conn_close<M: Metrics>( &mut self, quiche_conn: &mut QuicheConnection, metrics: &M, work_loop_result: &QuicResult<()>, )

Reports connection-level error metrics and forwards IOWorker errors to the associated H3Controller.

Source§

async fn wait_for_data( &mut self, qconn: &mut QuicheConnection, ) -> QuicResult<()>

Wait for incoming data from the H3Controller. The next iteration of the I/O loop commences when one of the select!ed futures triggers.

Source§

fn on_conn_established( &mut self, quiche_conn: &mut QuicheConnection, handshake_info: &HandshakeInfo, ) -> QuicResult<()>

Callback to customize the ApplicationOverQuic after the QUIC handshake completed successfully. Read more
Source§

fn should_act(&self) -> bool

Determines whether the application’s methods will be called by the worker. Read more
Source§

fn buffer(&mut self) -> &mut [u8]

A borrowed buffer for the worker to write outbound packets into. Read more
Source§

impl<H: DriverHooks> Drop for H3Driver<H>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<H> !Freeze for H3Driver<H>

§

impl<H> !RefUnwindSafe for H3Driver<H>

§

impl<H> Send for H3Driver<H>

§

impl<H> Sync for H3Driver<H>
where H: Sync,

§

impl<H> Unpin for H3Driver<H>
where H: Unpin,

§

impl<H> !UnwindSafe for H3Driver<H>

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
§

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

§

fn vzip(self) -> V