Expand description
OS notification bridge.
OsNotifier wraps a tauri::AppHandle (or any OsNotifyChannel impl in
tests) and gates OS-level notifications behind the user’s
Settings::notifications.os_enabled preference.
§Gating rules
An OS notification fires only when all three conditions hold:
Settings::notifications.os_enabled == truenotification.severityisSuccess,Warning, orError(i.e. notInfo).terminal == true— the caller signals that the transfer/operation has reached a final state (doneorfailed).
When any gate fails the method returns Ok(()) (silent skip).
When the underlying plugin call fails the method returns
Err(AppError::Network { .. }).
§OCP contract
The OsNotifyChannel trait is the extension point: adding a new channel
(e.g. Slack webhook, webhook-as-plugin) means implementing the one-method
trait. OsNotifier never hard-codes the plugin type — it accepts any
channel implementation through the trait.
Structs§
- AppHandle
Channel - Production
OsNotifyChannelbacked bytauri-plugin-notification. - Noop
OsChannel - An
OsNotifyChannelthat silently discards all notifications. - OsNotifier
- Sends OS notifications when gating rules pass.
Traits§
- OsNotify
Channel - Abstraction over any channel that can send an OS-style notification.