pub trait Notifications {
// Required methods
fn post(&self, notification: &Notification) -> PostFuture;
fn remove(&self, id: &str);
fn permission(&self) -> Option<&dyn NotificationPermission>;
fn replies(&self) -> Option<&dyn NotificationReplies>;
fn scheduling(&self) -> Option<&dyn NotificationScheduling>;
}Expand description
The system’s notifications.
Required Methods§
Sourcefn post(&self, notification: &Notification) -> PostFuture
fn post(&self, notification: &Notification) -> PostFuture
Shows notification, in place of the one posted under its id while that is still there.
It never asks the user and never reads the permission first: it answers
NotificationError::Denied where the system refuses the post itself, and otherwise the
system decides whether it shows. Whether the app may notify, and asking, is
Notifications::permission’s.
Sourcefn permission(&self) -> Option<&dyn NotificationPermission>
fn permission(&self) -> Option<&dyn NotificationPermission>
The user’s permission, where the system keeps one for the app; None where any app may
notify.
Sourcefn replies(&self) -> Option<&dyn NotificationReplies>
fn replies(&self) -> Option<&dyn NotificationReplies>
A typed reply, where the system takes one.
Sourcefn scheduling(&self) -> Option<&dyn NotificationScheduling>
fn scheduling(&self) -> Option<&dyn NotificationScheduling>
Delivery at a later time, held by the system whether or not the app runs.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".