Skip to main content

Notifications

Trait Notifications 

Source
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§

Source

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.

Source

fn remove(&self, id: &str)

Takes away the notification posted or scheduled under id.

Source

fn permission(&self) -> Option<&dyn NotificationPermission>

The user’s permission, where the system keeps one for the app; None where any app may notify.

Source

fn replies(&self) -> Option<&dyn NotificationReplies>

A typed reply, where the system takes one.

Source

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".

Implementors§