explicit_error/domain.rs
1/// This trait must be implemented for type that converts to [Error](crate::Error)
2/// Example of such implementation can be found in crates `explicit-error-http` or `explicit-error-exit` for `DomainError`.
3pub trait Domain
4where
5 Self: std::error::Error + 'static + std::fmt::Debug + Into<crate::error::Error<Self>>,
6{
7 fn with_context(self, context: impl std::fmt::Display) -> Self;
8
9 fn into_source(self) -> Option<Box<dyn std::error::Error>>;
10}