pub struct NeverResume;Expand description
A resume policy that never resumes, regardless of the error type.
This is useful to disable the default resume policy.
§Example
let policy = NeverResume.with_attempt_limit(3);
assert!(matches!(policy.on_error(&ResumeQuery::new(0), io_error()), ResumeResult::Permanent(_)));
assert!(matches!(policy.on_error(&ResumeQuery::new(1), io_error()), ResumeResult::Permanent(_)));
assert!(matches!(policy.on_error(&ResumeQuery::new(2), io_error()), ResumeResult::Permanent(_)));
assert!(matches!(policy.on_error(&ResumeQuery::new(3), io_error()), ResumeResult::Permanent(_)));
use google_cloud_gax::error::{Error, rpc::Code, rpc::Status};
fn io_error() -> Error {
// ... details omitted ...
}Trait Implementations§
Source§impl Debug for NeverResume
impl Debug for NeverResume
Source§impl ReadResumePolicy for NeverResume
impl ReadResumePolicy for NeverResume
Source§fn on_error(&self, _status: &ResumeQuery, error: Error) -> ResumeResult
fn on_error(&self, _status: &ResumeQuery, error: Error) -> ResumeResult
Determines if the read should continue after an error.
Auto Trait Implementations§
impl Freeze for NeverResume
impl RefUnwindSafe for NeverResume
impl Send for NeverResume
impl Sync for NeverResume
impl Unpin for NeverResume
impl UnsafeUnpin for NeverResume
impl UnwindSafe for NeverResume
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,
Source§impl<T> ReadResumePolicyExt for Twhere
T: ReadResumePolicy,
impl<T> ReadResumePolicyExt for Twhere
T: ReadResumePolicy,
Source§fn with_attempt_limit(self, maximum_attempts: u32) -> LimitedAttemptCount<Self>
fn with_attempt_limit(self, maximum_attempts: u32) -> LimitedAttemptCount<Self>
Decorates a ReadResumePolicy to limit the number of resume attempts. Read more
§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