pub(crate) struct Engine<'a> {
pub(crate) queue: Option<Queue<'a>>,
pub(crate) closer: &'a SessionCloser,
}Expand description
Everything execute may mutate.
Fields§
§queue: Option<Queue<'a>>The stream’s queue, or None at the datagram site.
Datagrams are per-connection and unordered by definition, so they
have no queue — and Action::Delay / Action::Hold are
refused there, so nothing can need one. None is not a degraded
mode; it is the datagram site’s shape.
closer: &'a SessionCloserWhere Action::CloseSession is recorded.
Implementations§
Source§impl Engine<'_>
impl Engine<'_>
Sourcefn queue_is_busy(&self) -> bool
fn queue_is_busy(&self) -> bool
Whether a unit written now would overtake something already waiting — or would escape the pacer.
The second term is the whole of the release wiring’s reach into this
module. Plan::WriteNow hands bytes straight to the transport, which
is correct and cheap on an unshaped stream and is exactly the path a
token bucket cannot see: PendingQueue::pop_next_due is the release
seam, and a unit that never enters the queue never reaches it. So a
shaped queue is always busy, and every unit on a shaped stream is
released rather than written.
Nothing else in this module knows a class, a bucket or a discipline.
The queue tags what it is handed from the class the pipe loop last
resolved, so push_unit stays the one place a push and its ledger
entry happen together.