pub struct LoadBalanceSegment {
pub destinations: Vec<OutcomeSegment>,
pub strategy: LoadBalanceStrategy,
pub round_robin_index: Arc<AtomicUsize>,
}Expand description
Outcome-aware LoadBalance segment. Holds N destinations + a strategy. On each call: strategy picks ONE destination (round-robin / failover / random / weighted), runs it. If chosen destination returns Completed, return Completed. If Stopped: return Stopped immediately (no failover — Stop is successful control flow). If Failed: strategy decides (failover retries next dest, others return Failed).
This differs from Multicast (which runs all branches) — LoadBalance picks exactly one. The parallel cancellation logic from T13/T15 does NOT apply.
Fields§
§destinations: Vec<OutcomeSegment>§strategy: LoadBalanceStrategy§round_robin_index: Arc<AtomicUsize>Shared round-robin index for interior mutability across cloned segments.
Trait Implementations§
Source§impl Clone for LoadBalanceSegment
impl Clone for LoadBalanceSegment
Source§fn clone(&self) -> LoadBalanceSegment
fn clone(&self) -> LoadBalanceSegment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl OutcomePipeline for LoadBalanceSegment
impl OutcomePipeline for LoadBalanceSegment
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 LoadBalanceSegment
impl !Sync for LoadBalanceSegment
impl !UnwindSafe for LoadBalanceSegment
impl Freeze for LoadBalanceSegment
impl Send for LoadBalanceSegment
impl Unpin for LoadBalanceSegment
impl UnsafeUnpin for LoadBalanceSegment
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