[][src]Enum genio::error::ChainError

pub enum ChainError<F, S> {
    First(F),
    Second(S),
}

Error returned when chained readers fail. It allows inspecting which reader failed, keeping it's own error type. For simplicity it can be also merged, if the two errors are convertible to resulting error.

Variants

First(F)

First reader failed.

Second(S)

Second reader failed.

Methods

impl<F, S> ChainError<F, S>[src]

pub fn merge<E>(self) -> E where
    F: Into<E>,
    S: Into<E>, 
[src]

If the two errors can be converted to same type, they can be easily merged by this method. This simply performs the conversion.

pub fn as_ref(&self) -> ChainError<&F, &S>[src]

Get ChainError containing references to errors.

pub fn as_ref_mut(&mut self) -> ChainError<&mut F, &mut S>[src]

Get ChainError containing mutable references to errors.

Trait Implementations

impl<F: Debug, S: Debug> Debug for ChainError<F, S>[src]

Auto Trait Implementations

impl<F, S> RefUnwindSafe for ChainError<F, S> where
    F: RefUnwindSafe,
    S: RefUnwindSafe

impl<F, S> Send for ChainError<F, S> where
    F: Send,
    S: Send

impl<F, S> Sync for ChainError<F, S> where
    F: Sync,
    S: Sync

impl<F, S> Unpin for ChainError<F, S> where
    F: Unpin,
    S: Unpin

impl<F, S> UnwindSafe for ChainError<F, S> where
    F: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.