hexeract_core/notification.rs
1/// Marker trait for messages announcing that something happened, with fan-out
2/// semantics: zero or more handlers may react to the same notification.
3///
4/// Unlike [`crate::Command`] and [`crate::Query`], a notification has no
5/// output and is not expected to be answered. It is broadcast to every
6/// handler registered for its type.
7///
8/// `Clone` is required because the mediator delivers an independent copy of
9/// the value to each registered handler.
10///
11/// # Example
12///
13/// ```
14/// use hexeract_core::Notification;
15///
16/// #[derive(Clone)]
17/// struct OrderShipped {
18/// pub order_id: uuid::Uuid,
19/// }
20///
21/// impl Notification for OrderShipped {}
22/// ```
23pub trait Notification: Send + Sync + Clone + 'static {}