pub enum QuicCommand {
ConnectionClose(ConnectionShutdownBehaviour),
Custom(Box<dyn FnOnce(&mut QuicheConnection) + Send + 'static>),
Stats(Box<dyn FnOnce(SocketStats) + Send + 'static>),
}
Expand description
A command to execute on a [quiche::Connection] in the context of an
ApplicationOverQuic
.
We expect most ApplicationOverQuic
implementations (such as
H3Driver) will provide some way to submit
actions for them to take, for example via a channel. This enum may be
accepted as part of those actions to inspect or alter the state of the
underlying connection.
Variants§
ConnectionClose(ConnectionShutdownBehaviour)
Close the connection with the given parameters.
Some packets may still be sent after this command has been executed, so
the worker task may continue running for a bit. See
[quiche::Connection::close
] for details.
Custom(Box<dyn FnOnce(&mut QuicheConnection) + Send + 'static>)
Execute a custom callback on the connection.
Stats(Box<dyn FnOnce(SocketStats) + Send + 'static>)
Collect the current SocketStats
from the connection.
Unlike QuicConnection::stats()
, these statistics are not cached and
instead are retrieved right before the command is executed.
Implementations§
Source§impl QuicCommand
impl QuicCommand
Sourcepub fn execute(self, qconn: &mut QuicheConnection)
pub fn execute(self, qconn: &mut QuicheConnection)
Consume the command and perform its operation on qconn
.
This method should be called by ApplicationOverQuic
implementations
when they receive a QuicCommand
to execute.
Trait Implementations§
Source§impl Debug for QuicCommand
impl Debug for QuicCommand
Source§impl From<QuicCommand> for ClientH3Command
impl From<QuicCommand> for ClientH3Command
Source§fn from(cmd: QuicCommand) -> Self
fn from(cmd: QuicCommand) -> Self
Source§impl From<QuicCommand> for ServerH3Command
impl From<QuicCommand> for ServerH3Command
Source§fn from(cmd: QuicCommand) -> Self
fn from(cmd: QuicCommand) -> Self
Auto Trait Implementations§
impl Freeze for QuicCommand
impl !RefUnwindSafe for QuicCommand
impl Send for QuicCommand
impl !Sync for QuicCommand
impl Unpin for QuicCommand
impl !UnwindSafe for QuicCommand
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