[−][src]Enum fibers::sync::oneshot::MonitorError
The reason that a monitored peer has not completed successfully.
Variants
The monitor channel is disconnected.
The monitored peer has exited with an error E
.
i.e., Monitored::exit(self, Err(E))
was called
Methods
impl<E> MonitorError<E>
[src]
pub fn map<F, T>(self, f: F) -> MonitorError<T> where
F: FnOnce(E) -> T,
[src]
F: FnOnce(E) -> T,
Maps an MonitorError<E>
to MonitorError<T>
by applying a function to a contained error.
Examples
use fibers::sync::oneshot::MonitorError; let mut e = MonitorError::Failed(10); assert_eq!(e.map(|v| v.to_string()), MonitorError::Failed("10".to_string())); e = MonitorError::Aborted; assert_eq!(e.map(|v| v.to_string()), MonitorError::Aborted);
pub fn unwrap_or(self, or_error: E) -> E
[src]
Unwraps MonitorError
and returns the internal error E
.
If self
is MonitorError::Aborted
, or_error
will be returned.
Examples
use fibers::sync::oneshot::MonitorError; let e = MonitorError::Aborted; assert_eq!(e.unwrap_or(10), 10); let e = MonitorError::Failed(20); assert_eq!(e.unwrap_or(10), 20);
pub fn unwrap_or_else<F>(self, f: F) -> E where
F: FnOnce() -> E,
[src]
F: FnOnce() -> E,
Unwraps MonitorError
and returns the internal error E
.
If self
is MonitorError::Aborted
, the result of f()
will be returned.
Trait Implementations
impl<E: Clone> Clone for MonitorError<E>
[src]
fn clone(&self) -> MonitorError<E>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<E: Eq> Eq for MonitorError<E>
[src]
impl<E: PartialEq> PartialEq<MonitorError<E>> for MonitorError<E>
[src]
fn eq(&self, other: &MonitorError<E>) -> bool
[src]
fn ne(&self, other: &MonitorError<E>) -> bool
[src]
impl<E: Display> Display for MonitorError<E>
[src]
impl<E: Debug> Debug for MonitorError<E>
[src]
impl<E> StructuralPartialEq for MonitorError<E>
[src]
impl<E> StructuralEq for MonitorError<E>
[src]
impl<E: Error> Error for MonitorError<E>
[src]
Auto Trait Implementations
impl<E> Send for MonitorError<E> where
E: Send,
E: Send,
impl<E> Sync for MonitorError<E> where
E: Sync,
E: Sync,
impl<E> Unpin for MonitorError<E> where
E: Unpin,
E: Unpin,
impl<E> UnwindSafe for MonitorError<E> where
E: UnwindSafe,
E: UnwindSafe,
impl<E> RefUnwindSafe for MonitorError<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,