pub struct Aip194Strict;Expand description
A retry policy that strictly follows AIP-194.
This policy must be decorated to limit the number of retry attempts or the duration of the retry loop.
The policy interprets AIP-194 strictly, the retry decision for server-side errors are based only on the status code, and the only retryable status code is “UNAVAILABLE”.
§Example
let policy = Aip194Strict;
assert!(policy.on_error(&RetryState::new(true), transient_error()).is_continue());
assert!(policy.on_error(&RetryState::new(true), permanent_error()).is_permanent());
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 Aip194Strict
impl Clone for Aip194Strict
Source§fn clone(&self) -> Aip194Strict
fn clone(&self) -> Aip194Strict
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 Aip194Strict
impl Debug for Aip194Strict
impl RetryPolicy for Aip194Strict
Auto Trait Implementations§
impl Freeze for Aip194Strict
impl RefUnwindSafe for Aip194Strict
impl Send for Aip194Strict
impl Sync for Aip194Strict
impl Unpin for Aip194Strict
impl UnsafeUnpin for Aip194Strict
impl UnwindSafe for Aip194Strict
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