pub trait UniErrorOps: UniDisplay + Deref<Target = dyn Error + Send + Sync + 'static> {
// Required methods
fn kind_code(&self) -> i32;
fn kind_code2(&self) -> i32;
fn kind_value(&self) -> Cow<'static, str>;
fn kind_context_str(&self) -> Option<Cow<'static, str>>;
fn prev_cause<'e>(&'e self) -> Option<Cause<'e>>;
fn chain(&self) -> Chain<'_> ⓘ;
fn root_cause(&self) -> Option<Cause<'_>>;
// Provided method
fn is_simple(&self) -> bool { ... }
}Expand description
A trait that specifies the operations that can be performed on a UniError.
Required Methods§
Sourcefn kind_code2(&self) -> i32
fn kind_code2(&self) -> i32
Returns a 2nd code (typically for FFI) for this specific kind.
Sourcefn kind_value(&self) -> Cow<'static, str>
fn kind_value(&self) -> Cow<'static, str>
The string value of the kind, if any. This is useful for programmatic evaluation when the type is boxed in the error chain and the type is not known
Sourcefn kind_context_str(&self) -> Option<Cow<'static, str>>
fn kind_context_str(&self) -> Option<Cow<'static, str>>
Returns additional context for this specific kind, if any
Sourcefn prev_cause<'e>(&'e self) -> Option<Cause<'e>>
fn prev_cause<'e>(&'e self) -> Option<Cause<'e>>
Returns a reference to the first entry in the cause chain.
Sourcefn root_cause(&self) -> Option<Cause<'_>>
fn root_cause(&self) -> Option<Cause<'_>>
Returns the root cause of this error. If None is returned then this error is the root cause.
Provided Methods§
Sourcefn is_simple(&self) -> bool
fn is_simple(&self) -> bool
Returns true if the error is a SimpleError.