pub struct NeverRetry;Expand description
A retry policy that never retries.
This policy is useful when the client already has (or may already have) a retry policy configured, and you want to avoid retrying a particular method.
§Example
let policy = NeverRetry;
assert!(policy.on_error(&RetryState::new(true), transient_error()).is_exhausted());
assert!(policy.on_error(&RetryState::new(true), permanent_error()).is_exhausted());
use google_cloud_gax::error::{Error, rpc::Code, rpc::Status};
fn transient_error() -> Error { Error::service(Status::default().set_code(Code::Unavailable)) }
fn permanent_error() -> Error { Error::service(Status::default().set_code(Code::PermissionDenied)) }Trait Implementations§
Source§impl Clone for NeverRetry
impl Clone for NeverRetry
Source§fn clone(&self) -> NeverRetry
fn clone(&self) -> NeverRetry
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 moreSource§impl Debug for NeverRetry
impl Debug for NeverRetry
impl RetryPolicy for NeverRetry
Auto Trait Implementations§
impl Freeze for NeverRetry
impl RefUnwindSafe for NeverRetry
impl Send for NeverRetry
impl Sync for NeverRetry
impl Unpin for NeverRetry
impl UnsafeUnpin for NeverRetry
impl UnwindSafe for NeverRetry
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> RetryPolicyExt for Twhere
T: RetryPolicy,
impl<T> RetryPolicyExt for Twhere
T: RetryPolicy,
Source§fn with_time_limit(self, maximum_duration: Duration) -> LimitedElapsedTime<Self>
fn with_time_limit(self, maximum_duration: Duration) -> LimitedElapsedTime<Self>
Decorate a RetryPolicy to limit the total elapsed time in the retry loop. Read more
Source§fn with_attempt_limit(self, maximum_attempts: u32) -> LimitedAttemptCount<Self>
fn with_attempt_limit(self, maximum_attempts: u32) -> LimitedAttemptCount<Self>
Decorate a RetryPolicy to limit the number of retry attempts. Read more
Source§fn continue_on_too_many_requests(self) -> TooManyRequests<Self>
fn continue_on_too_many_requests(self) -> TooManyRequests<Self>
Decorate a RetryPolicy to continue on certain status codes. Read more
Source§fn continue_on_client_timeout(self) -> ClientTimeout<Self>
fn continue_on_client_timeout(self) -> ClientTimeout<Self>
Decorate a RetryPolicy to continue on client-side timeouts. Read more