Skip to main content

execute

Function execute 

Source
pub(crate) fn execute(
    unit: &Unit<'_>,
    action: Action,
    engine: &mut Engine<'_>,
    report: &Reporter<'_>,
) -> Outcome
Expand description

Execute one Action at one site.

Emits exactly one ProxyEvent::ActionApplied or exactly one ProxyEvent::ActionRefused, plus any impairment the decision produced, and returns the wire operation the caller must perform.

A refused unit is forwarded unchanged, through the same queue-or-write-now fork an admitted Pass takes — a refusal must not let a unit overtake one already waiting.

§Order of checks

  1. crate::capability::classify on the (site, kind) pair. The site’s own verdict comes first because it is the one the published table makes, and the table must win: Delay { then: ResetStream } at the datagram site is the datagram column’s WrongSite, not a composition complaint.
  2. Composition, for Action::Delay / Action::Hold, which is validated before the unit is queued so a bad composition never reaches the deque and never bumps egress_items_queued.
  3. The inner action, classified in its own right — Delay { then: ReplacePayload(b) } with the wrong length is Refusal::LengthChanged, reported against the inner kind, which is the informative one.
  4. The numeric code range, then the session-closing latch.