pub struct RetriableRequestBuilder { /* private fields */ }Expand description
A reqwest::RequestBuilder wrapper that automatically retries failed
requests using an exponential back-off strategy powered by the backon
crate. Use RequestBuilderExt::with_retry to construct one.
Implementations§
Source§impl RetriableRequestBuilder
impl RetriableRequestBuilder
Sourcepub fn backoff(self, backoff: ExponentialBuilder) -> Self
pub fn backoff(self, backoff: ExponentialBuilder) -> Self
Overrides the default back-off settings.
Sourcepub fn retry_only_when(
self,
retry_if: fn(&AlienError<ErrorData>) -> bool,
) -> Self
pub fn retry_only_when( self, retry_if: fn(&AlienError<ErrorData>) -> bool, ) -> Self
Retries only the errors retry_if accepts, instead of every retryable one. For a request
that must not be sent twice once the service may have acted on it.
Sourcepub async fn send_json<T: DeserializeOwned + Send + 'static>(self) -> Result<T>
pub async fn send_json<T: DeserializeOwned + Send + 'static>(self) -> Result<T>
Execute the request, applying retries, and parse the body as JSON.
Sourcepub async fn send_xml<T: DeserializeOwned + Send + 'static>(self) -> Result<T>
pub async fn send_xml<T: DeserializeOwned + Send + 'static>(self) -> Result<T>
Execute the request, applying retries, and parse the body as XML.
Sourcepub async fn send_no_response(self) -> Result<()>
pub async fn send_no_response(self) -> Result<()>
Execute the request, applying retries, without parsing the response body.
Auto Trait Implementations§
impl !Freeze for RetriableRequestBuilder
impl !RefUnwindSafe for RetriableRequestBuilder
impl !UnwindSafe for RetriableRequestBuilder
impl Forget for RetriableRequestBuilder
impl Move for RetriableRequestBuilder
impl Send for RetriableRequestBuilder
impl Sync for RetriableRequestBuilder
impl Unpin for RetriableRequestBuilder
impl UnsafeUnpin for RetriableRequestBuilder
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