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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use crateErrorKind;
/// Levels of Urgency.
///
/// # Specification
/// > Developers must use their own judgement when deciding the urgency of a notification. Typically, if the majority of programs are using the same level for a specific type of urgency, other applications should follow them.
/// >
/// > For low and normal urgencies, server implementations may display the notifications how they choose. They should, however, have a sane expiration timeout dependent on the urgency level.
/// >
/// > **Critical notifications should not automatically expire**, as they are things that the user will most likely want to know about. They should only be closed when the user dismisses them, for example, by clicking on the notification.
///
/// <cite> — see [Galago](http://www.galago-project.org/specs/notification/0.9/x320.html) or [Gnome](https://developer.gnome.org/notification-spec/#urgency-levels) specification.</cite>
///
/// # Example
/// ```no_run
/// # use notify_rust::*;
/// # fn _doc() -> Result<(), Box<dyn std::error::Error>> {
/// Notification::new()
/// .summary("oh no")
/// .icon("dialog-warning")
/// .urgency(Urgency::Critical)
/// .show()?;
/// # Ok(())
/// # }
/// ```
///
// TODO: remove this in v5.0
// #[cfg(not(feature = "server"))]
// // TODO: make this the default in v5.0
// #[cfg(feature = "server")]
// impl From<u8> for Urgency {
// fn from(int: u8) -> Urgency {
// match int {
// 0 => Urgency::Low,
// 1 => Urgency::Normal,
// 2..=std::u8::MAX => Urgency::Critical,
// }
// }
// }