pub struct ChoiceSegment {
pub clauses: Vec<WhenClauseSegment>,
pub otherwise: Option<OutcomeSegment>,
}Expand description
Outcome-aware structural EIP segment for the Choice pattern.
Evaluates when clauses in order. The first matching predicate runs its
body (which can return Completed, Stopped, or Failed). If no
predicate matches, the otherwise segment runs (if present); otherwise
returns Completed(original_exchange).
Unlike ChoiceService (which operates at the Tower layer and cannot
preserve Stopped(ex) with mutations), ChoiceSegment operates at the
PipelineOutcome layer and preserves the exchange at the Stop point
including all mutations.
Fields§
§clauses: Vec<WhenClauseSegment>§otherwise: Option<OutcomeSegment>Trait Implementations§
Source§impl Clone for ChoiceSegment
impl Clone for ChoiceSegment
Source§impl OutcomePipeline for ChoiceSegment
impl OutcomePipeline for ChoiceSegment
Source§fn clone_box(&self) -> Box<dyn OutcomePipeline>
fn clone_box(&self) -> Box<dyn OutcomePipeline>
Clone the segment into a new boxed instance. Required because
Box<dyn OutcomePipeline> cannot directly derive Clone.Auto Trait Implementations§
impl !RefUnwindSafe for ChoiceSegment
impl !Sync for ChoiceSegment
impl !UnwindSafe for ChoiceSegment
impl Freeze for ChoiceSegment
impl Send for ChoiceSegment
impl Unpin for ChoiceSegment
impl UnsafeUnpin for ChoiceSegment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more