Skip to main content

enqueue_unshown

Function enqueue_unshown 

Source
pub(crate) fn enqueue_unshown(
    pending: &mut PendingQueue,
    deferred: &mut DeferredEffects,
    raw: Bytes,
    report: &Reporter<'_>,
)
Expand description

Queue bytes the hook was never shown, on a shaped stream.

The counterpart of session.rs’s write_in_order, which drains and then writes inline. That is right on an unshaped stream and wrong on a shaped one twice over: it would let a stream header or an oversized object’s passthrough chunk escape the pacer, and — worse — the drain it runs first honours release times, so on a paced queue it would block the read arm for as long as the bucket took, inside a select! arm body that polls no other branch.

Lives here rather than in session.rs for the reason write_in_order’s own doc gives: DeferredEffects’s push is this module’s, so the ledger and the deque can only move together. The entry is None — these bytes were never a hook decision, so nothing is owed at release.

The class is not a parameter: the queue carries the one the pipe loop most recently resolved (PendingQueue::tag_unit), which for a header or a passthrough chunk is Class::Unshapeable.