use crate::icon::Icon;
#[derive(Clone, Debug)]
pub struct Notification {
pub(crate) title: String,
pub(crate) body: String,
pub(crate) icon: Option<Icon>,
}
impl Notification {
pub fn new(title: impl Into<String>, body: impl Into<String>) -> Notification {
Notification {
title: title.into(),
body: body.into(),
icon: None,
}
}
pub fn with_icon(mut self, icon: Icon) -> Notification {
self.icon = Some(icon);
self
}
pub fn title(&self) -> &str {
&self.title
}
pub fn body(&self) -> &str {
&self.body
}
pub fn icon(&self) -> Option<&Icon> {
self.icon.as_ref()
}
}