pub struct FailoverStep { /* private fields */ }Expand description
One link of a Failover chain: a provider, the model it is asked for,
how long an attempt may take to start answering, and how many attempts
it gets before the chain moves on.
Implementations§
Source§impl FailoverStep
impl FailoverStep
pub fn new(provider: impl Provider + 'static) -> FailoverStep
pub fn from_arc(provider: Arc<dyn Provider>) -> FailoverStep
Sourcepub fn model(self, model: impl Into<String>) -> FailoverStep
pub fn model(self, model: impl Into<String>) -> FailoverStep
Ask this step for model instead of the request’s model.
Sourcepub fn deadline(self, deadline: Duration) -> FailoverStep
pub fn deadline(self, deadline: Duration) -> FailoverStep
How long one attempt may take to produce its first stream event (or,
through Provider::complete, its whole response). Default 90s.
Each attempt gets the full deadline, whatever earlier ones used.
Sourcepub fn attempts(self, attempts: u32) -> FailoverStep
pub fn attempts(self, attempts: u32) -> FailoverStep
Attempts on this step before the chain moves on (default 1).
Trait Implementations§
Source§impl Clone for FailoverStep
impl Clone for FailoverStep
Source§fn clone(&self) -> FailoverStep
fn clone(&self) -> FailoverStep
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for FailoverStep
impl !UnwindSafe for FailoverStep
impl Forget for FailoverStep
impl Freeze for FailoverStep
impl Move for FailoverStep
impl Send for FailoverStep
impl Sync for FailoverStep
impl Unpin for FailoverStep
impl UnsafeUnpin for FailoverStepwhere
*const ArcInner<dyn Provider> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Provider>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
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