Skip to main content

NotificationExt

Trait NotificationExt 

Source
pub trait NotificationExt<R: Runtime> {
    // Required method
    fn notification(&self) -> &Notification<R>;
}
Expand description

Extensions to tauri::App, tauri::AppHandle, tauri::WebviewWindow, tauri::Webview and tauri::Window to access the notification APIs.

Required Methods§

Source

fn notification(&self) -> &Notification<R>

Returns the notification APIs managed by the plugin.

§Examples
use tauri_plugin_notification::NotificationExt;

fn notify<R: tauri::Runtime>(app: &tauri::AppHandle<R>) {
  app.notification()
    .builder()
    .title("Tauri")
    .body("Tauri is awesome!")
    .show()
    .unwrap();
}

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<R: Runtime, T: Manager<R>> NotificationExt<R> for T