pub struct Notification<R: Runtime>(/* private fields */);Expand description
Access to the notification APIs.
You can get an instance of this type via NotificationExt
Implementations§
Source§impl<R: Runtime> Notification<R>
impl<R: Runtime> Notification<R>
Sourcepub fn builder(&self) -> NotificationBuilder<R>
pub fn builder(&self) -> NotificationBuilder<R>
Creates a new builder for a notification.
§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();
}Sourcepub fn request_permission(&self) -> Result<PermissionState>
pub fn request_permission(&self) -> Result<PermissionState>
Requests the permission to send notifications.
Desktop applications do not need to ask for this permission,
so this always resolves to PermissionState::Granted without prompting the user.
Sourcepub fn permission_state(&self) -> Result<PermissionState>
pub fn permission_state(&self) -> Result<PermissionState>
Checks whether the permission to send notifications was granted.
Desktop applications do not need to ask for this permission,
so this always resolves to PermissionState::Granted.
Auto Trait Implementations§
impl<R> !RefUnwindSafe for Notification<R>
impl<R> !UnwindSafe for Notification<R>
impl<R> Freeze for Notification<R>
impl<R> Send for Notification<R>
impl<R> Sync for Notification<R>
impl<R> Unpin for Notification<R>
impl<R> UnsafeUnpin for Notification<R>where
AppHandle<R>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more