brazier 0.1.0

A mediator implementation in Rust, heavily inspired by the .NET MediatR package (https://github.com/jbogard/MediatR).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// This error is returned whenever something goes wrong within the mediator itself.
#[derive(Debug, PartialEq)]
pub enum MediatorError {
    /// The handler is not registerd.
    /// Please register the handler before using it.
    HandlerNotRegisteredError,
}

impl std::error::Error for MediatorError {}

impl std::fmt::Display for MediatorError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            MediatorError::HandlerNotRegisteredError => write!(f, "Handler not registered"),
        }
    }
}