1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! What a service says happened.
//!
//! This is the extension point of the whole module. A service adds a notification by
//! implementing [`NotificationEvent`] for a struct that carries the facts — not by
//! writing another HTTP call, another locale lookup or another payload map inline at
//! the call site. The struct doubles as documentation of the workflow's template
//! variables, and its fields are the only thing a reviewer has to check against the
//! notification center.
use Severity;
/// One notifiable business fact, bound to the workflow that renders it.
///
/// Implementations should be plain data — build one at the point where the fact becomes
/// true, and hand it to [`Notifier`](super::Notifier). `Send + Sync` is required so an
/// event can be handed to a background task
/// ([`Notifier::notify_detached`](super::Notifier::notify_detached)); plain data
/// satisfies it automatically.