pub struct RoutingSuperset { /* private fields */ }Expand description
Bundled routing superset: pool load-balancing with fallback chain and health tracking.
Implementations§
Source§impl RoutingSuperset
impl RoutingSuperset
Sourcepub fn new(
pool: Vec<RoutingTarget>,
fallback: Vec<FallbackEntry>,
strategy: RoutingStrategy,
breaker_config: CircuitBreakerConfig,
) -> Self
pub fn new( pool: Vec<RoutingTarget>, fallback: Vec<FallbackEntry>, strategy: RoutingStrategy, breaker_config: CircuitBreakerConfig, ) -> Self
Create a new superset router.
Sourcepub fn route(&mut self, now_secs: u64) -> Result<SupersetRoutingDecision>
pub fn route(&mut self, now_secs: u64) -> Result<SupersetRoutingDecision>
Select a target and return a routing decision. Increments in-flight for the chosen target.
Sourcepub fn record_outcome(&mut self, target_id: &str, success: bool, now_secs: u64)
pub fn record_outcome(&mut self, target_id: &str, success: bool, now_secs: u64)
Record success or failure for a previously routed target.
Sourcepub fn strategy(&self) -> RoutingStrategy
pub fn strategy(&self) -> RoutingStrategy
Current load-balancing strategy.
Sourcepub fn pool(&self) -> &[RoutingTarget]
pub fn pool(&self) -> &[RoutingTarget]
Primary target pool.
Sourcepub fn fallback(&self) -> &[FallbackEntry]
pub fn fallback(&self) -> &[FallbackEntry]
Fallback chain entries.
Sourcepub fn breaker_config(&self) -> CircuitBreakerConfig
pub fn breaker_config(&self) -> CircuitBreakerConfig
Breaker configuration applied to new health entries.
Trait Implementations§
Source§impl Clone for RoutingSuperset
impl Clone for RoutingSuperset
Source§fn clone(&self) -> RoutingSuperset
fn clone(&self) -> RoutingSuperset
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 moreAuto Trait Implementations§
impl Freeze for RoutingSuperset
impl RefUnwindSafe for RoutingSuperset
impl Send for RoutingSuperset
impl Sync for RoutingSuperset
impl Unpin for RoutingSuperset
impl UnsafeUnpin for RoutingSuperset
impl UnwindSafe for RoutingSuperset
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