Skip to main content

Module stage

Module stage 

Source
Expand description

The Stage trait and its StageError. The Stage trait: the async, effecting half of a pipeline stage, and the preemptible run loop (Stage::run) that drives one.

A stage is a Processor — synchronous, state-owning decide_* — plus an async Stage::perform that interprets the effects decide_* emitted and does the actual I/O. The split is the core invariant: decide_* takes &mut self and is the only place state changes; perform takes &self and must never mutate state, so the run loop can drop an in-flight perform future on an interrupt without leaving torn state behind.

Stage::run ties a stage to an Inbound and an Outbound and drives it. Its default body is the leaf run loop; a composite stage (a Pipeline) overrides it to drive its children — which is why a pipeline is itself a Stage and can nest.

Structs§

StageError
Why a Stage::perform call failed.

Traits§

Stage
The async, effecting half of a pipeline stage.