pub enum RetryHint {
Retryable,
NonRetryable,
}Expand description
Describes whether an error instance is safe and useful to retry.
This is intentionally separate from StatusCode: status code describes the
error category exposed to users, while retry hint describes retry policy for
this specific error instance.
Variants§
Retryable
The operation may succeed if retried later.
NonRetryable
Retrying the same operation is not expected to help.
This is the default for errors that do not explicitly opt in to retry.
Implementations§
Source§impl RetryHint
impl RetryHint
pub fn is_retryable(self) -> bool
pub fn as_str(self) -> &'static str
pub fn serialize_as_str<S>(
hint: &Self,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
pub fn deserialize_from_str<'de, D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Trait Implementations§
impl Copy for RetryHint
impl Eq for RetryHint
impl StructuralPartialEq for RetryHint
Auto Trait Implementations§
impl Freeze for RetryHint
impl RefUnwindSafe for RetryHint
impl Send for RetryHint
impl Sync for RetryHint
impl Unpin for RetryHint
impl UnsafeUnpin for RetryHint
impl UnwindSafe for RetryHint
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].