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§
Sourcefn show(&self, notification: Notification) -> Result<(), NotificationError>
fn show(&self, notification: Notification) -> Result<(), NotificationError>
Posts a new notification.
Sourcefn request_permission(&self) -> NotificationPermission
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".