explicit-error 0.2.3

Explicit concrete Error type for binary crates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// This trait must be implemented for type that converts to [Error](crate::Error)
/// Example of such implementation can be found in crates `explicit-error-http` or `explicit-error-exit` for `DomainError`.
pub trait Domain
where
    Self: std::error::Error
        + 'static
        + std::fmt::Debug
        + Into<crate::error::Error<Self>>
        + Send
        + Sync,
{
    fn with_context(self, context: impl std::fmt::Display) -> Self;

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

    fn into_source(self) -> Option<Box<dyn std::error::Error + Send + Sync>>;
}