pub enum Retryable {
Default,
Custom(Arc<dyn Fn(&ProviderError) -> bool + Send + Sync>),
}Expand description
Retry judgment: which errors are worth retrying.
Custom closures are not comparable, so PartialEq is implemented by
hand (only Default values equal each other); Debug is also
hand-written (a closure only prints its variant name).
Variants§
Default
Default: Network / Timeout / RateLimited / Api (status >= 500); 4xx (auth / invalid arguments / quota exhausted) are not retried — retrying would not change the outcome.
Custom(Arc<dyn Fn(&ProviderError) -> bool + Send + Sync>)
Custom judgment (e.g. only retry rate limits, or exclude certain 4xx by message content).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Retryable
impl !UnwindSafe for Retryable
impl Freeze for Retryable
impl Send for Retryable
impl Sync for Retryable
impl Unpin for Retryable
impl UnsafeUnpin for Retryable
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