pub enum CallResult<TResult> {
Success(TResult),
Timeout,
SenderError,
}Expand description
The result from a crate::rpc::call operation
Variants§
Success(TResult)
Success, with the result
Timeout
Timeout
SenderError
The transmission channel was dropped without any message(s) being sent
Implementations§
Source§impl<T> CallResult<T>
impl<T> CallResult<T>
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Determine if the CallResult is a CallResult::Success
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Determine if the CallResult is a CallResult::Timeout
Sourcepub fn is_send_error(&self) -> bool
pub fn is_send_error(&self) -> bool
Determine if the CallResult is a CallResult::SenderError
Sourcepub fn unwrap(self) -> T
pub fn unwrap(self) -> T
Unwrap a CallResult, panicking on any non-success
Sourcepub fn expect(self, msg: &'static str) -> T
pub fn expect(self, msg: &'static str) -> T
Unwrap a CallResult, panicking on non-succcess with the specified message
Sourcepub fn unwrap_or(self, default: T) -> T
pub fn unwrap_or(self, default: T) -> T
Unwrap the CallResult or give a default value
Sourcepub fn unwrap_or_else<F>(self, f: F) -> Twhere
F: FnOnce() -> T,
pub fn unwrap_or_else<F>(self, f: F) -> Twhere
F: FnOnce() -> T,
Returns the CallResult’s success result or computes the closure
Sourcepub fn success_or<E>(self, err: E) -> Result<T, E>
pub fn success_or<E>(self, err: E) -> Result<T, E>
Transforms the CallResult to a Result mapping Success(t) to Ok(t) and all else to Err(err)
Sourcepub fn success_or_else<E, F>(self, err: F) -> Result<T, E>where
F: FnOnce() -> E,
pub fn success_or_else<E, F>(self, err: F) -> Result<T, E>where
F: FnOnce() -> E,
Transforms the CallResult to a Result mapping Success(t) to Ok(t) and all else to Err(err())
Sourcepub fn map<O, F>(self, mapping: F) -> CallResult<O>where
F: FnOnce(T) -> O,
pub fn map<O, F>(self, mapping: F) -> CallResult<O>where
F: FnOnce(T) -> O,
Maps the success value of the CallResult to another type
Sourcepub fn map_or<O, F>(self, default: O, mapping: F) -> Owhere
F: FnOnce(T) -> O,
pub fn map_or<O, F>(self, default: O, mapping: F) -> Owhere
F: FnOnce(T) -> O,
Maps the success value of the CallResult to another type or returns the default value
Sourcepub fn map_or_else<D, O, F>(self, default: D, mapping: F) -> O
pub fn map_or_else<D, O, F>(self, default: D, mapping: F) -> O
Maps the success value of the CallResult to another type or returns the default function result
Trait Implementations§
Source§impl<TResult> Debug for CallResult<TResult>where
TResult: Debug,
impl<TResult> Debug for CallResult<TResult>where
TResult: Debug,
Source§impl<T, TResult> From<CallResult<TResult>> for RactorErr<T>
impl<T, TResult> From<CallResult<TResult>> for RactorErr<T>
Source§fn from(value: CallResult<TResult>) -> RactorErr<T>
fn from(value: CallResult<TResult>) -> RactorErr<T>
Source§impl<TResult> PartialEq for CallResult<TResult>where
TResult: PartialEq,
impl<TResult> PartialEq for CallResult<TResult>where
TResult: PartialEq,
impl<TResult> Eq for CallResult<TResult>where
TResult: Eq,
impl<TResult> StructuralPartialEq for CallResult<TResult>
Auto Trait Implementations§
impl<TResult> Freeze for CallResult<TResult>where
TResult: Freeze,
impl<TResult> RefUnwindSafe for CallResult<TResult>where
TResult: RefUnwindSafe,
impl<TResult> Send for CallResult<TResult>where
TResult: Send,
impl<TResult> Sync for CallResult<TResult>where
TResult: Sync,
impl<TResult> Unpin for CallResult<TResult>where
TResult: Unpin,
impl<TResult> UnwindSafe for CallResult<TResult>where
TResult: UnwindSafe,
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more