Skip to main content

Module os

Module os 

Source
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:

  1. Settings::notifications.os_enabled == true
  2. notification.severity is Success, Warning, or Error (i.e. not Info).
  3. terminal == true — the caller signals that the transfer/operation has reached a final state (done or failed).

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§

AppHandleChannel
Production OsNotifyChannel backed by tauri-plugin-notification.
NoopOsChannel
An OsNotifyChannel that silently discards all notifications.
OsNotifier
Sends OS notifications when gating rules pass.

Traits§

OsNotifyChannel
Abstraction over any channel that can send an OS-style notification.