pub struct Chain { /* private fields */ }Expand description
Everything that runs on one direction, split into segments.
One segment is the common common case and runs entirely on the reading task.
A stage declared Detached starts a new segment, which the host runs on its
own task behind a bounded channel; subsequent inline stages join that
segment rather than spawning more.
Implementations§
Source§impl Chain
impl Chain
pub fn new(meta: PipelineMeta, segments: Vec<Segment>) -> Self
pub fn meta(&self) -> &PipelineMeta
pub fn segments(&self) -> &[Segment]
pub fn into_segments(self) -> Vec<Segment>
Sourcepub fn datagram_hazard(&self) -> Option<&str>
pub fn datagram_hazard(&self) -> Option<&str>
The first stage on this chain that must not carry datagrams, if any.
A subprocess never can: its stdin and stdout are byte streams, so message boundaries are gone the moment bytes cross the pipe.
Sourcepub fn declarations(&self) -> Vec<Declaration<'_>>
pub fn declarations(&self) -> Vec<Declaration<'_>>
Every stage’s boundary declaration, flattened across segments.
A detached subprocess is Boundaries::Fuse whatever it runs: its
stdin and stdout are byte streams, so units do not cross the pipe.
Sourcepub fn boundary_faults(
&self,
upstream_datagram: bool,
downstream_datagram: bool,
) -> Vec<BoundaryFault<'_>>
pub fn boundary_faults( &self, upstream_datagram: bool, downstream_datagram: bool, ) -> Vec<BoundaryFault<'_>>
Every stage on this chain whose requirement the path does not meet.
Each requiring stage is checked by walking away from it towards the end
it named. The scan stops at the first stage that settles the question:
a frame below satisfies a downstream requirement however many stages
fuse under it, an unframe above satisfies an upstream one, and a stage
that does not carry units in the direction of travel is the fault. A
scan that reaches the end of the chain is answered by the endpoint,
which carries messages only when it is a datagram endpoint.
Both flags are oriented for this chain’s direction: upstream is the
endpoint it reads from and downstream the one it writes to.