1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
/// Chooses if a notification will be sent for a new message.
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
// todo: #[non_exhaustive]
pub enum NotificationState {
    /// The notification will be enabled.
    Enabled,
    /// The notification will be disabled.
    Disabled,
}

impl NotificationState {
    /// Checks if the state is `Enabled`.
    pub fn is_enabled(self) -> bool {
        self == NotificationState::Enabled
    }

    /// Checks if the state is `Disabled`.
    pub fn is_disabled(self) -> bool {
        self == NotificationState::Disabled
    }
}