pub trait StackError:
Display
+ Debug
+ Send
+ Sync {
// Required methods
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static);
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>;
fn as_dyn(&self) -> &dyn StackError;
fn meta(&self) -> Option<&Meta>;
fn source(&self) -> Option<ErrorRef<'_>>;
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result;
fn is_transparent(&self) -> bool;
// Provided methods
fn as_ref(&self) -> ErrorRef<'_> { ... }
fn stack(&self) -> Chain<'_> ⓘ { ... }
fn sources(&self) -> Chain<'_> ⓘ { ... }
fn report(&self) -> Report<'_> { ... }
}Expand description
Trait implemented by errors produced by this crate.
It extends std::error::Error semantics with optional error metadata,
and a source method where sources may also provide metadata.
Required Methods§
Sourcefn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.
Sourcefn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.
Sourcefn as_dyn(&self) -> &dyn StackError
fn as_dyn(&self) -> &dyn StackError
Returns this error as a dyn StackError.
Sourcefn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.
Sourcefn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".