pub struct ChoiceGroupSegment {
pub group: Arc<dyn PredicateGroup>,
pub metas: Vec<EvalMeta>,
pub bodies: Vec<OutcomeSegment>,
pub otherwise: Option<OutcomeSegment>,
}Expand description
Outcome-aware structural EIP segment for grouped when clauses that share
one language.
Grouped evaluation of same-language when clauses — one group evaluation
per message replaces per-clause PredicateSource::matches. Clause order,
first-match, and error semantics are identical to ChoiceSegment.
Fields§
§group: Arc<dyn PredicateGroup>The shared-language predicate group evaluated once per message.
metas: Vec<EvalMeta>Per-clause evaluation metadata, parallel to bodies.
bodies: Vec<OutcomeSegment>Sub-pipeline for each clause, parallel to metas.
otherwise: Option<OutcomeSegment>Pipeline to run when no clause matches.
Implementations§
Source§impl ChoiceGroupSegment
impl ChoiceGroupSegment
Sourcepub fn new(
group: Arc<dyn PredicateGroup>,
metas: Vec<EvalMeta>,
bodies: Vec<OutcomeSegment>,
otherwise: Option<OutcomeSegment>,
) -> Result<Self, CamelError>
pub fn new( group: Arc<dyn PredicateGroup>, metas: Vec<EvalMeta>, bodies: Vec<OutcomeSegment>, otherwise: Option<OutcomeSegment>, ) -> Result<Self, CamelError>
Build a grouped choice segment.
metas and bodies are parallel: metas[i] attributes an error from
clause i and bodies[i] is the pipeline to run when clause i is the
first match. Empty groups are rejected because the compiler falls back
to the sequential path for 0/1 clauses.
Trait Implementations§
Source§impl Clone for ChoiceGroupSegment
impl Clone for ChoiceGroupSegment
Source§impl OutcomePipeline for ChoiceGroupSegment
impl OutcomePipeline for ChoiceGroupSegment
Source§fn clone_box(&self) -> Box<dyn OutcomePipeline>
fn clone_box(&self) -> Box<dyn OutcomePipeline>
Box<dyn OutcomePipeline> cannot directly derive Clone.