Enum ibc_relayer::util::retry::RetryResult
source · [−]pub enum RetryResult<T, E> {
Ok(T),
Retry(E),
Err(E),
}Expand description
A result that represents either success, retryable failure, or immediately-returning failure.
Variants
Ok(T)
Contains the success value.
Retry(E)
Contains the error value if duration is exceeded.
Err(E)
Contains an error value to return immediately.
Implementations
sourceimpl<T, E> OperationResult<T, E>
impl<T, E> OperationResult<T, E>
sourcepub fn is_ok(&self) -> bool
pub fn is_ok(&self) -> bool
Returns true if the result is OperationResult::Ok.
Examples
Basic usage:
let x: OperationResult<i32, &str> = OperationResult::Ok(-3);
assert_eq!(x.is_ok(), true);
let x: OperationResult<i32, &str> = OperationResult::Retry("Some error message");
assert_eq!(x.is_ok(), false);
let x: OperationResult<i32, &str> = OperationResult::Err("Some other error message");
assert_eq!(x.is_ok(), false);sourcepub fn is_retry(&self) -> bool
pub fn is_retry(&self) -> bool
Returns true if the result is OperationResult::Retry.
Examples
Basic usage:
let x: OperationResult<i32, &str> = OperationResult::Ok(-3);
assert_eq!(x.is_retry(), false);
let x: OperationResult<i32, &str> = OperationResult::Retry("Some error message");
assert_eq!(x.is_retry(), true);
let x: OperationResult<i32, &str> = OperationResult::Err("Some other error message");
assert_eq!(x.is_retry(), false);sourcepub fn is_err(&self) -> bool
pub fn is_err(&self) -> bool
Returns true if the result is OperationResult::Err.
Examples
Basic usage:
let x: OperationResult<i32, &str> = OperationResult::Ok(-3);
assert_eq!(x.is_err(), false);
let x: OperationResult<i32, &str> = OperationResult::Retry("Some error message");
assert_eq!(x.is_err(), false);
let x: OperationResult<i32, &str> = OperationResult::Err("Some other error message");
assert_eq!(x.is_err(), true);Trait Implementations
sourceimpl<T, E> Clone for OperationResult<T, E> where
T: Clone,
E: Clone,
impl<T, E> Clone for OperationResult<T, E> where
T: Clone,
E: Clone,
sourcefn clone(&self) -> OperationResult<T, E>
fn clone(&self) -> OperationResult<T, E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T, E> Debug for OperationResult<T, E> where
T: Debug,
E: Debug,
impl<T, E> Debug for OperationResult<T, E> where
T: Debug,
E: Debug,
sourceimpl<T, E> From<Result<T, E>> for OperationResult<T, E>
impl<T, E> From<Result<T, E>> for OperationResult<T, E>
sourcefn from(item: Result<T, E>) -> OperationResult<T, E>
fn from(item: Result<T, E>) -> OperationResult<T, E>
Converts to this type from the input type.
sourceimpl<T, E> Hash for OperationResult<T, E> where
T: Hash,
E: Hash,
impl<T, E> Hash for OperationResult<T, E> where
T: Hash,
E: Hash,
sourceimpl<T, E> Ord for OperationResult<T, E> where
T: Ord,
E: Ord,
impl<T, E> Ord for OperationResult<T, E> where
T: Ord,
E: Ord,
sourceimpl<T, E> PartialEq<OperationResult<T, E>> for OperationResult<T, E> where
T: PartialEq<T>,
E: PartialEq<E>,
impl<T, E> PartialEq<OperationResult<T, E>> for OperationResult<T, E> where
T: PartialEq<T>,
E: PartialEq<E>,
sourcefn eq(&self, other: &OperationResult<T, E>) -> bool
fn eq(&self, other: &OperationResult<T, E>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &OperationResult<T, E>) -> bool
fn ne(&self, other: &OperationResult<T, E>) -> bool
This method tests for !=.
sourceimpl<T, E> PartialOrd<OperationResult<T, E>> for OperationResult<T, E> where
T: PartialOrd<T>,
E: PartialOrd<E>,
impl<T, E> PartialOrd<OperationResult<T, E>> for OperationResult<T, E> where
T: PartialOrd<T>,
E: PartialOrd<E>,
sourcefn partial_cmp(&self, other: &OperationResult<T, E>) -> Option<Ordering>
fn partial_cmp(&self, other: &OperationResult<T, E>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<T, E> Copy for OperationResult<T, E> where
T: Copy,
E: Copy,
impl<T, E> Eq for OperationResult<T, E> where
T: Eq,
E: Eq,
impl<T, E> StructuralEq for OperationResult<T, E>
impl<T, E> StructuralPartialEq for OperationResult<T, E>
Auto Trait Implementations
impl<T, E> RefUnwindSafe for OperationResult<T, E> where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for OperationResult<T, E> where
E: Send,
T: Send,
impl<T, E> Sync for OperationResult<T, E> where
E: Sync,
T: Sync,
impl<T, E> Unpin for OperationResult<T, E> where
E: Unpin,
T: Unpin,
impl<T, E> UnwindSafe for OperationResult<T, E> where
E: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T in a tonic::Request
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more