pub enum ChainError<F, S> {
First(F),
Second(S),
}
Expand description
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§
Implementations§
Source§impl<F, S> ChainError<F, S>
impl<F, S> ChainError<F, S>
Sourcepub fn merge<E>(self) -> E
pub fn merge<E>(self) -> E
If the two errors can be converted to same type, they can be easily merged by this method. This simply performs the conversion.
Sourcepub fn as_ref(&self) -> ChainError<&F, &S>
pub fn as_ref(&self) -> ChainError<&F, &S>
Get ChainError
containing references to errors.
Sourcepub fn as_ref_mut(&mut self) -> ChainError<&mut F, &mut S>
pub fn as_ref_mut(&mut self) -> ChainError<&mut F, &mut S>
Get ChainError containing mutable references to errors.
Trait Implementations§
Auto Trait Implementations§
impl<F, S> Freeze for ChainError<F, S>
impl<F, S> RefUnwindSafe for ChainError<F, S>where
F: RefUnwindSafe,
S: RefUnwindSafe,
impl<F, S> Send for ChainError<F, S>
impl<F, S> Sync for ChainError<F, S>
impl<F, S> Unpin for ChainError<F, S>
impl<F, S> UnwindSafe for ChainError<F, S>where
F: UnwindSafe,
S: 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
Mutably borrows from an owned value. Read more