pub(crate) enum DrainOutcome {
Complete,
CancelledMidDrain,
Terminated {
forwarded: usize,
code: u64,
},
WriteFailed,
Discarded,
}Expand description
How a drain ended.
Variants§
Complete
Every queued unit was written.
CancelledMidDrain
Cancellation won mid-drain. The remainder was flushed ignoring
release times; PendingQueue::unconfirmed_bytes afterwards is
what that fallback either could not write or wrote into a
transport that is being closed out from under it, and is what
Impairment { QueuedBytesAtTeardown } carries.
Terminated
A queued terminal fired. The destination is reset and nothing further may be written to it.
Fields
WriteFailed
A write failed. The failing unit and everything behind it are still queued. Only the best-effort drain returns this; the release-honouring drain propagates the error instead.
Discarded
The teardown flush declined to write anything, because the session’s
EgressGauge is discarding: a requested close ran out of drain
time, so what is left is reported rather than handed to a connection
that is about to be closed. The queue is untouched, so
PendingQueue::unconfirmed_bytes is exactly what was abandoned.
Trait Implementations§
Source§impl Clone for DrainOutcome
impl Clone for DrainOutcome
Source§fn clone(&self) -> DrainOutcome
fn clone(&self) -> DrainOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more