pub struct DefaultFailover {
pub base_delay: Duration,
}Expand description
The default FailoverPolicy.
Fields§
§base_delay: DurationTrait Implementations§
Source§impl Clone for DefaultFailover
impl Clone for DefaultFailover
Source§fn clone(&self) -> DefaultFailover
fn clone(&self) -> DefaultFailover
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 DefaultFailover
Source§impl Debug for DefaultFailover
impl Debug for DefaultFailover
Source§impl Default for DefaultFailover
impl Default for DefaultFailover
Source§fn default() -> DefaultFailover
fn default() -> DefaultFailover
Returns the “default value” for a type. Read more
Source§impl FailoverPolicy for DefaultFailover
impl FailoverPolicy for DefaultFailover
Source§fn after_error(
&self,
_request: &ModelRequest,
error: &ProviderError,
attempt: u32,
attempts: u32,
) -> FailoverAction
fn after_error( &self, _request: &ModelRequest, error: &ProviderError, attempt: u32, attempts: u32, ) -> FailoverAction
request is what the failed attempt sent; attempt counts from 1;
attempts is the step’s limit.Source§fn prepare_step(&self, _request: &mut ModelRequest)
fn prepare_step(&self, _request: &mut ModelRequest)
Shape
request for this step before its first attempt: it already
names the step’s model (FailoverStep::model), so what is only
valid for another model (a reasoning signature, an encrypted
reasoning item) can be dropped here. Default: leave it as it is.Source§fn before_attempt(&self, _request: &ModelRequest) -> Result<(), ProviderError>
fn before_attempt(&self, _request: &ModelRequest) -> Result<(), ProviderError>
Whether to send
request on this step at all. An error skips the
attempt and is handled as its failure (for example, a model the app
knows is out of credit). Default: send it.Auto Trait Implementations§
impl Forget for DefaultFailover
impl Freeze for DefaultFailover
impl Move for DefaultFailover
impl RefUnwindSafe for DefaultFailover
impl Send for DefaultFailover
impl Sync for DefaultFailover
impl Unpin for DefaultFailover
impl UnsafeUnpin for DefaultFailover
impl UnwindSafe for DefaultFailover
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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