Trait Domain

Source
pub trait Domain
where Self: Error + 'static + Debug + Into<Error<Self>> + Send + Sync,
{ // Required methods fn with_context(self, context: impl Display) -> Self; fn context(&self) -> Option<&str>; fn into_source(self) -> Option<Box<dyn Error + Send + Sync>>; }
Expand description

This trait must be implemented for type that converts to Error Example of such implementation can be found in crates explicit-error-http or explicit-error-exit for DomainError.

Required Methods§

Source

fn with_context(self, context: impl Display) -> Self

Source

fn context(&self) -> Option<&str>

Source

fn into_source(self) -> Option<Box<dyn Error + Send + Sync>>

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.

Implementors§