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 H3Event
s of note and send H3Command
s into the I/O loop.
Implementations§
Source§impl<H: DriverHooks> H3Driver<H>
impl<H: DriverHooks> H3Driver<H>
Sourcepub fn new(http3_settings: Http3Settings) -> (Self, H3Controller<H>)
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>
impl<H: DriverHooks> ApplicationOverQuic for H3Driver<H>
Source§fn process_reads(&mut self, qconn: &mut QuicheConnection) -> QuicResult<()>
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<()>
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<()>,
)
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<()>
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<()>
fn on_conn_established( &mut self, quiche_conn: &mut QuicheConnection, handshake_info: &HandshakeInfo, ) -> QuicResult<()>
ApplicationOverQuic
after the QUIC
handshake completed successfully. Read moreSource§fn should_act(&self) -> bool
fn should_act(&self) -> bool
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> 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
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>
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>
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