pub enum Throttle {
RetryAfter(Duration),
Exhausted,
}Expand description
How a 429 should be handled. Observed 2026-07-27 against the real API: a
throttle 429 carries x-should-retry: true, a rate_limit_error body, and NO
anthropic-ratelimit-unified-* headers at all - so “the account is spent” and
“slow down for a moment” are different events that look similar. Treating a
throttle as exhaustion would abandon a perfectly good account; treating
exhaustion as a throttle would retry a wall forever.
Variants§
RetryAfter(Duration)
Retry the SAME account after this long.
Exhausted
Do not retry here - the account is out of quota (rotate instead).
Trait Implementations§
impl StructuralPartialEq for Throttle
Auto Trait Implementations§
impl Freeze for Throttle
impl RefUnwindSafe for Throttle
impl Send for Throttle
impl Sync for Throttle
impl Unpin for Throttle
impl UnsafeUnpin for Throttle
impl UnwindSafe for Throttle
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
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> ⓘ
Converts
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> ⓘ
Converts
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