pub(crate) trait EgressSink {
// Required methods
fn write_all(
&mut self,
buf: &[u8],
) -> impl Future<Output = Result<(), EgressError>> + Send;
fn reset(&mut self, code: u64) -> Result<(), EgressError>;
}Expand description
The write half this module drives.
A trait rather than a bare &mut SendStream for exactly one reason:
the ordering, clamping, terminal and cancellation behaviour below is
then testable in-process against a recording sink, with no QUIC
handshake and no timing. The only production implementor is
SendStream.
write_all returns impl Future + Send rather than being an
async fn: the forwarding tasks are spawned onto a multi-threaded
runtime, so every future this module builds has to be Send, and an
async fn in a trait carries no such bound.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".