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: where the system does not let the app notify, because the user was
never asked or said no, it answers NotificationError::Denied, as the systems’ own posts
do, and the app asks first through Notifications::permission.
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".