pub enum RoutingStrategy {
Reaper,
Carousel,
Cushion,
Maximus,
}Expand description
Account-selection algorithm used when no sticky or pinned account applies.
Variants§
Reaper
Harvest every token before the window expires — use-it-or-lose-it.
Drains accounts whose quota windows expire soonest first, then prefers
the account with the most remaining quota. Maximises total token usage over time.
Config: "reaper"
Carousel
Spins through accounts in a fixed round-robin cycle, ignoring quota state.
Config: "carousel"
Cushion
Always routes to the account with the softest landing — the most remaining
capacity across both 5h and 7d windows (binding window primary, secondary as tiebreak).
Config: "cushion"
Maximus
Time-weighted dual-window optimizer. Scores each account as:
health_5h = 1 - (time_fraction_5h × util_5h)
health_7d = 1 - (time_fraction_7d × util_7d)
score = health_5h × health_7d
where time_fraction = secs_to_reset / window_duration (0 = resetting now, 1 = just started).
Accounts for how much quota remains AND how soon each window refreshes.
Config: "maximus"
Implementations§
Trait Implementations§
Source§impl Clone for RoutingStrategy
impl Clone for RoutingStrategy
Source§fn clone(&self) -> RoutingStrategy
fn clone(&self) -> RoutingStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RoutingStrategy
impl Debug for RoutingStrategy
Source§impl Default for RoutingStrategy
impl Default for RoutingStrategy
Source§fn default() -> RoutingStrategy
fn default() -> RoutingStrategy
Source§impl PartialEq for RoutingStrategy
impl PartialEq for RoutingStrategy
Source§fn eq(&self, other: &RoutingStrategy) -> bool
fn eq(&self, other: &RoutingStrategy) -> bool
self and other values to be equal, and is used by ==.impl Copy for RoutingStrategy
impl Eq for RoutingStrategy
impl StructuralPartialEq for RoutingStrategy
Auto Trait Implementations§
impl Freeze for RoutingStrategy
impl RefUnwindSafe for RoutingStrategy
impl Send for RoutingStrategy
impl Sync for RoutingStrategy
impl Unpin for RoutingStrategy
impl UnsafeUnpin for RoutingStrategy
impl UnwindSafe for RoutingStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more