[−][src]Trait failchain::ResultExt
Extension trait which adds the family of .chain_err
methods to Result
objects.
Associated Types
Loading content...Required methods
fn chain_inspect_err<ErrorKindT: ChainErrorKind>(
self,
map: impl FnOnce(&mut Self::Error) -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
self,
map: impl FnOnce(&mut Self::Error) -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
Like chain_err
, but the callback is given an opportunity to inspect the original error.
Provided methods
fn chain_err<ErrorKindT: ChainErrorKind>(
self,
map: impl FnOnce() -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
self,
map: impl FnOnce() -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
Replace the error in a Result with a new error built from map
's ErrorKind
output.
The original error is stored as the cause
/source
of the new one.
Implementations on Foreign Types
impl<SuccessT, ErrorT: Fail> ResultExt for Result<SuccessT, ErrorT>
[src]
type Success = SuccessT
type Error = ErrorT
fn chain_inspect_err<ErrorKindT: ChainErrorKind>(
self,
chain: impl FnOnce(&mut ErrorT) -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
[src]
self,
chain: impl FnOnce(&mut ErrorT) -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
fn chain_err<ErrorKindT: ChainErrorKind>(
self,
map: impl FnOnce() -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>
[src]
self,
map: impl FnOnce() -> ErrorKindT
) -> Result<Self::Success, ErrorKindT::Error>