pub struct Recommended;Expand description
The recommended policy when reading objects from Cloud Storage.
This policy resumes any read that fails due to I/O errors, and stops on any other error kind.
§Example
let policy = Recommended;
assert!(matches!(policy.on_error(&ResumeQuery::new(0), io_error()), ResumeResult::Continue(_)));
assert!(matches!(policy.on_error(&ResumeQuery::new(0), other_error()), ResumeResult::Permanent(_)));
use gax::error::{Error, rpc::Code, rpc::Status};
fn io_error() -> Error {
// ... details omitted ...
}
fn other_error() -> Error {
// ... details omitted ...
}Trait Implementations§
Source§impl Debug for Recommended
impl Debug for Recommended
Source§impl ReadResumePolicy for Recommended
impl ReadResumePolicy for Recommended
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 Recommended
impl RefUnwindSafe for Recommended
impl Send for Recommended
impl Sync for Recommended
impl Unpin for Recommended
impl UnwindSafe for Recommended
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> 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::RequestSource§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