pub trait ResultExt {
type Context: ?Sized;
type Ok;
// Required methods
fn attach<A>(self, attachment: A) -> Result<Self::Ok, Report<Self::Context>>
where A: Attachment;
fn attach_with<A, F>(
self,
attachment: F,
) -> Result<Self::Ok, Report<Self::Context>>
where A: Attachment,
F: FnOnce() -> A;
fn attach_opaque<A>(
self,
attachment: A,
) -> Result<Self::Ok, Report<Self::Context>>
where A: OpaqueAttachment;
fn attach_opaque_with<A, F>(
self,
attachment: F,
) -> Result<Self::Ok, Report<Self::Context>>
where A: OpaqueAttachment,
F: FnOnce() -> A;
fn change_context<C>(self, context: C) -> Result<Self::Ok, Report<C>>
where C: Error + Send + Sync + 'static;
fn change_context_lazy<C, F>(
self,
context: F,
) -> Result<Self::Ok, Report<C>>
where C: Error + Send + Sync + 'static,
F: FnOnce() -> C;
}Required Associated Types§
Required Methods§
Sourcefn attach<A>(self, attachment: A) -> Result<Self::Ok, Report<Self::Context>>where
A: Attachment,
fn attach<A>(self, attachment: A) -> Result<Self::Ok, Report<Self::Context>>where
A: Attachment,
Adds a new printable attachment to the Report inside the Result.
Applies Report::attach on the Err variant, refer to it for more
information.
Sourcefn attach_with<A, F>(
self,
attachment: F,
) -> Result<Self::Ok, Report<Self::Context>>where
A: Attachment,
F: FnOnce() -> A,
fn attach_with<A, F>(
self,
attachment: F,
) -> Result<Self::Ok, Report<Self::Context>>where
A: Attachment,
F: FnOnce() -> A,
Lazily adds a new printable attachment to the Report inside the Result.
Applies Report::attach on the Err variant, refer to it for more
information.
Sourcefn attach_opaque<A>(
self,
attachment: A,
) -> Result<Self::Ok, Report<Self::Context>>where
A: OpaqueAttachment,
fn attach_opaque<A>(
self,
attachment: A,
) -> Result<Self::Ok, Report<Self::Context>>where
A: OpaqueAttachment,
Adds a new attachment to the Report inside the Result.
Applies Report::attach_opaque on the Err variant, refer to it for more information.
Sourcefn attach_opaque_with<A, F>(
self,
attachment: F,
) -> Result<Self::Ok, Report<Self::Context>>where
A: OpaqueAttachment,
F: FnOnce() -> A,
fn attach_opaque_with<A, F>(
self,
attachment: F,
) -> Result<Self::Ok, Report<Self::Context>>where
A: OpaqueAttachment,
F: FnOnce() -> A,
Lazily adds a new attachment to the Report inside the Result.
Applies Report::attach_opaque on the Err variant, refer to it for more information.
Sourcefn change_context<C>(self, context: C) -> Result<Self::Ok, Report<C>>
fn change_context<C>(self, context: C) -> Result<Self::Ok, Report<C>>
Changes the context of the Report inside the Result.
Applies Report::change_context on the Err variant, refer to it for more information.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".