pub struct RoutingSelector;Expand description
Pure selection helpers — deterministic given inputs and mutable state.
Implementations§
Source§impl RoutingSelector
impl RoutingSelector
Sourcepub fn select(
strategy: RoutingStrategy,
pool: &[RoutingTarget],
state: &mut RoutingPoolState,
now_secs: u64,
p2c_seed: u64,
) -> Option<usize>
pub fn select( strategy: RoutingStrategy, pool: &[RoutingTarget], state: &mut RoutingPoolState, now_secs: u64, p2c_seed: u64, ) -> Option<usize>
Select a pool index using strategy. Returns None if no healthy target exists.
Sourcepub fn select_fallback<'a>(
chain: &'a [FallbackEntry],
health: &HashMap<String, TargetHealth>,
counter: &mut u64,
now_secs: u64,
) -> Option<&'a RoutingTarget>
pub fn select_fallback<'a>( chain: &'a [FallbackEntry], health: &HashMap<String, TargetHealth>, counter: &mut u64, now_secs: u64, ) -> Option<&'a RoutingTarget>
Walk the fallback chain by rank; within each rank, weighted-select among healthy entries.
Trait Implementations§
Source§impl Clone for RoutingSelector
impl Clone for RoutingSelector
Source§fn clone(&self) -> RoutingSelector
fn clone(&self) -> RoutingSelector
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 moreimpl Copy for RoutingSelector
Source§impl Debug for RoutingSelector
impl Debug for RoutingSelector
Source§impl Default for RoutingSelector
impl Default for RoutingSelector
Source§fn default() -> RoutingSelector
fn default() -> RoutingSelector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RoutingSelector
impl RefUnwindSafe for RoutingSelector
impl Send for RoutingSelector
impl Sync for RoutingSelector
impl Unpin for RoutingSelector
impl UnsafeUnpin for RoutingSelector
impl UnwindSafe for RoutingSelector
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