pub enum ResumeResult {
Permanent(Error),
Exhausted(Error),
Continue(Error),
}Expand description
The result of a loop control decision.
§Example
#[derive(Debug)]
struct MyRetryPolicy;
impl google_cloud_gax::retry_policy::RetryPolicy for MyRetryPolicy {
fn on_error(&self, state: &RetryState, error: Error) -> RetryResult {
if state.attempt_count > 42 {
return RetryResult::Exhausted(error);
}
RetryResult::Continue(error)
}
fn on_throttle(&self, state: &RetryState, error: Error) -> ThrottleResult {
}
}Variants§
Permanent(Error)
The error is non-retryable, stop the loop.
Exhausted(Error)
The error is retryable, but the policy is stopping the loop.
Loop control policies may stop the loop on retryable errors, for example, because the policy only allows a limited number of attempts.
Continue(Error)
The error was retryable, continue the loop.
Implementations§
Source§impl RetryResult
impl RetryResult
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Returns true if the operation should not be retried due to a permanent error.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Returns true if the operation should not be retried because the retry policy is exhausted.
Sourcepub fn is_continue(&self) -> bool
pub fn is_continue(&self) -> bool
Returns true if the operation should be retried.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RetryResult
impl !UnwindSafe for RetryResult
impl Freeze for RetryResult
impl Send for RetryResult
impl Sync for RetryResult
impl Unpin for RetryResult
impl UnsafeUnpin for RetryResult
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more