Trait overflow_error::ErrorWith
[−]
[src]
pub trait ErrorWith<Val: ?Sized> { type Without: Fail; fn as_error(&self) -> Self::Without; fn as_value(&self) -> &Val; fn into_value(self) -> Val
where
Self: Sized,
Val: Sized; fn into_error(self) -> Self::Without
where
Self: Sized,
Val: Sized, { ... } fn map<F, Ret>(self, f: F) -> <Self::Without as ErrorBase<Ret>>::With
where
Self: Sized,
Val: Sized,
F: Fn(Val) -> Ret,
Self::Without: ErrorBase<Ret>,
<Self::Without as ErrorBase<Ret>>::With: Sized, { ... } }
The failure of a particular operation, with the given operand(s).
Can be attached with a value of type Val
, if Val
is sized.
Associated Types
Required Methods
fn as_error(&self) -> Self::Without
Gets the underlying error.
fn as_value(&self) -> &Val
References the attached value.
fn into_value(self) -> Val where
Self: Sized,
Val: Sized,
Self: Sized,
Val: Sized,
Consumes this error and returns the attached value.
Provided Methods
fn into_error(self) -> Self::Without where
Self: Sized,
Val: Sized,
Self: Sized,
Val: Sized,
Discards the attached value and returns the underlying error.
fn map<F, Ret>(self, f: F) -> <Self::Without as ErrorBase<Ret>>::With where
Self: Sized,
Val: Sized,
F: Fn(Val) -> Ret,
Self::Without: ErrorBase<Ret>,
<Self::Without as ErrorBase<Ret>>::With: Sized,
Self: Sized,
Val: Sized,
F: Fn(Val) -> Ret,
Self::Without: ErrorBase<Ret>,
<Self::Without as ErrorBase<Ret>>::With: Sized,
Maps a function over the attached value.
Implementors
impl<T: ?Sized> ErrorWith<T> for DivValueByZero<T> type Without = DivByZero;
impl<T: ?Sized> ErrorWith<T> for CannotDivValue<T> type Without = CannotDiv;
impl<T: ?Sized> ErrorWith<T> for OverflowedValue<T> type Without = Overflowed;
impl<T: ?Sized> ErrorWith<T> for WouldOverflowValue<T> type Without = WouldOverflow;