pub struct ThrottleSegment {
pub config: ThrottlerConfig,
pub limiter: Arc<Mutex<RateLimiter>>,
pub body: OutcomeSegment,
}Expand description
Outcome-aware throttle segment (ADR-0025).
Wraps a ThrottlerConfig + shared RateLimiter + child sub-pipeline body.
Unlike ThrottlerService (which operates at the Tower layer),
ThrottleSegment correctly propagates PipelineOutcome::Stopped / Failed
from the body.
Fields§
§config: ThrottlerConfig§limiter: Arc<Mutex<RateLimiter>>§body: OutcomeSegmentImplementations§
Source§impl ThrottleSegment
impl ThrottleSegment
Sourcepub fn new(config: ThrottlerConfig, body: OutcomeSegment) -> Self
pub fn new(config: ThrottlerConfig, body: OutcomeSegment) -> Self
Construct a throttle segment. Panics if invariants are violated.
Prefer try_new.
Sourcepub fn try_new(
config: ThrottlerConfig,
body: OutcomeSegment,
) -> Result<Self, CamelError>
pub fn try_new( config: ThrottlerConfig, body: OutcomeSegment, ) -> Result<Self, CamelError>
Fallible constructor. Same validation as ThrottlerService::try_new.
Trait Implementations§
Source§impl Clone for ThrottleSegment
impl Clone for ThrottleSegment
Source§impl OutcomePipeline for ThrottleSegment
impl OutcomePipeline for ThrottleSegment
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 ThrottleSegment
impl !Sync for ThrottleSegment
impl !UnwindSafe for ThrottleSegment
impl Freeze for ThrottleSegment
impl Send for ThrottleSegment
impl Unpin for ThrottleSegment
impl UnsafeUnpin for ThrottleSegment
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