Skip to main content

NotificationHandler

Trait NotificationHandler 

Source
pub trait NotificationHandler: Send + Sync {
    // Required methods
    fn show(&self, notification: Notification) -> Result<(), NotificationError>;
    fn dismiss(&self, id: &str) -> Result<(), NotificationError>;
    fn request_permission(&self) -> NotificationPermission;
}
Expand description

Core interface for routing and dispatching notification events.

Required Methods§

Source

fn show(&self, notification: Notification) -> Result<(), NotificationError>

Posts a new notification.

Source

fn dismiss(&self, id: &str) -> Result<(), NotificationError>

Dismisses a notification by ID.

Source

fn request_permission(&self) -> NotificationPermission

Requests delivery permission.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§