pub struct RetryBackend { /* private fields */ }Expand description
An HttpBackend that retries requests through an inner backend per a RetryPolicy.
Purely additive: it only takes effect when a caller wraps their backend in it and installs it via
Client::with_backend. See the module docs for the timing and cloneability contracts.
Implementations§
Source§impl RetryBackend
impl RetryBackend
Sourcepub fn new(inner: Arc<dyn HttpBackend>, policy: Arc<dyn RetryPolicy>) -> Self
pub fn new(inner: Arc<dyn HttpBackend>, policy: Arc<dyn RetryPolicy>) -> Self
Wrap inner so requests are retried according to policy.
Sourcepub fn inner(&self) -> &Arc<dyn HttpBackend> ⓘ
pub fn inner(&self) -> &Arc<dyn HttpBackend> ⓘ
The wrapped inner backend.
Trait Implementations§
Source§impl Clone for RetryBackend
impl Clone for RetryBackend
Source§impl Debug for RetryBackend
impl Debug for RetryBackend
Source§impl HttpBackend for RetryBackend
impl HttpBackend for RetryBackend
Source§fn execute(&self, request: Request) -> ExecuteFuture<'_>
fn execute(&self, request: Request) -> ExecuteFuture<'_>
Execute a prepared request, yielding the raw response or a transport failure. A backend that
fails should wrap the originating
reqwest::Error via TransportError::new so
[super::send] can reclassify timeouts/redirects/protocol errors into the taxonomy.Auto Trait Implementations§
impl !RefUnwindSafe for RetryBackend
impl !UnwindSafe for RetryBackend
impl Freeze for RetryBackend
impl Send for RetryBackend
impl Sync for RetryBackend
impl Unpin for RetryBackend
impl UnsafeUnpin for RetryBackend
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