pub trait ProblemResult<OkT> {
Show 13 methods
// Required methods
fn via<ErrorT>(self, error: ErrorT) -> Result<OkT, Problem>
where ErrorT: 'static + Error + Send + Sync;
fn map_via<ErrorT, FromT>(self, from: FromT) -> Result<OkT, Problem>
where ErrorT: 'static + Error + Send + Sync,
FromT: FnOnce() -> ErrorT;
fn with<AttachmentT>(self, attachment: AttachmentT) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync;
fn map_with<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync,
FromT: FnOnce() -> AttachmentT;
fn with_once<AttachmentT>(
self,
attachment: AttachmentT,
) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync;
fn map_with_once<AttachmentT, FromT>(
self,
from: FromT,
) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync,
FromT: FnOnce() -> AttachmentT;
fn maybe_with<AttachmentT>(
self,
attachment: Option<AttachmentT>,
) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync;
fn maybe_map_with<AttachmentT, FromT>(
self,
from: FromT,
) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync,
FromT: FnOnce() -> Option<AttachmentT>;
fn maybe_with_once<AttachmentT>(
self,
attachment: Option<AttachmentT>,
) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync;
fn maybe_map_with_once<AttachmentT, FromT>(
self,
from: FromT,
) -> Result<OkT, Problem>
where AttachmentT: Any + Send + Sync,
FromT: FnOnce() -> Option<AttachmentT>;
fn with_location(self) -> Result<OkT, Problem>;
fn with_backtrace(self) -> Result<OkT, Problem>;
fn into_io_error(self) -> Result<OkT>;
}Expand description
Problemo extensions for Result.
Required Methods§
Sourcefn via<ErrorT>(self, error: ErrorT) -> Result<OkT, Problem>
fn via<ErrorT>(self, error: ErrorT) -> Result<OkT, Problem>
Adds the error to the top of the causation chain.
Sourcefn map_via<ErrorT, FromT>(self, from: FromT) -> Result<OkT, Problem>
fn map_via<ErrorT, FromT>(self, from: FromT) -> Result<OkT, Problem>
Adds the error to the top of the causation chain.
Sourcefn with<AttachmentT>(self, attachment: AttachmentT) -> Result<OkT, Problem>
fn with<AttachmentT>(self, attachment: AttachmentT) -> Result<OkT, Problem>
Attach to the top cause.
Sourcefn map_with<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
fn map_with<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
Attach to the top cause.
Sourcefn with_once<AttachmentT>(self, attachment: AttachmentT) -> Result<OkT, Problem>
fn with_once<AttachmentT>(self, attachment: AttachmentT) -> Result<OkT, Problem>
Attach to the top cause only if we don’t already have one of the same type.
Sourcefn map_with_once<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
fn map_with_once<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
Attach to the top cause only if we don’t already have one of the same type.
Sourcefn maybe_with<AttachmentT>(
self,
attachment: Option<AttachmentT>,
) -> Result<OkT, Problem>
fn maybe_with<AttachmentT>( self, attachment: Option<AttachmentT>, ) -> Result<OkT, Problem>
Attach to the top cause if Some.
Sourcefn maybe_map_with<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
fn maybe_map_with<AttachmentT, FromT>(self, from: FromT) -> Result<OkT, Problem>
Attach to the top cause.
Sourcefn maybe_with_once<AttachmentT>(
self,
attachment: Option<AttachmentT>,
) -> Result<OkT, Problem>
fn maybe_with_once<AttachmentT>( self, attachment: Option<AttachmentT>, ) -> Result<OkT, Problem>
Attach to the top cause if Some and we don’t already have one of the same type.
Sourcefn maybe_map_with_once<AttachmentT, FromT>(
self,
from: FromT,
) -> Result<OkT, Problem>
fn maybe_map_with_once<AttachmentT, FromT>( self, from: FromT, ) -> Result<OkT, Problem>
Attach to the top cause if Some and we don’t already have one of the same type.
Sourcefn with_location(self) -> Result<OkT, Problem>
fn with_location(self) -> Result<OkT, Problem>
Attach a Location (via Location::caller) if we don’t already have one.
Sourcefn with_backtrace(self) -> Result<OkT, Problem>
fn with_backtrace(self) -> Result<OkT, Problem>
Attach a backtrace to the top cause if we don’t already have one.
Sourcefn into_io_error(self) -> Result<OkT>
fn into_io_error(self) -> Result<OkT>
Into io::Error with ErrorKind::Other.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.