serenade_notifier/channel.rs
1//! Notification channel kinds.
2
3/// Delivery channel for a [`crate::Notification`].
4#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
5pub enum Channel {
6 /// SMS (phone number recipient).
7 Sms,
8 /// Mobile push (device token recipient).
9 Push,
10}
11
12impl Channel {
13 /// Stable lowercase name (`sms`, `push`).
14 #[must_use]
15 pub const fn as_str(self) -> &'static str {
16 match self {
17 Self::Sms => "sms",
18 Self::Push => "push",
19 }
20 }
21}