Skip to main content

Crate tilo_notify

Crate tilo_notify 

Source
Expand description

User notifications: one API on Linux, macOS and the web.

A Notification is shown under a stable tag: showing the same tag again replaces it, and Notifier::withdraw takes it away. Where the platform keeps notifications for an app that is not running, Notifier::schedule hands one over for later. system is this target’s backend.

TargetBackend
Linuxthe connection the app’s session serves it (service); with host-portals, the notification portal or org.freedesktop.Notifications on the session bus instead
macOSUNUserNotificationCenter, which needs the app bundle’s identifier: an unbundled binary answers NotifyError::Unavailable
Webthe Notifications API, while the page is open

Modules§

conformance
The contract every Notifier keeps, as checks a backend’s tests run, plus a Recording notifier.
service
The notification service an app’s session serves it: an app shows, replaces, withdraws and schedules notifications over the connection its launcher opened for it, and what the person does with one comes back on the same connection.

Structs§

AlarmSchedule
AlarmState
CalendarAlarm
An alarm in this device’s local time. Monday is bit zero; no weekdays means a single occurrence. A repeating alarm needs no network connection.
Notification
NotificationButton
NotificationSender
Who a notification is from: their name, the stable id their face is drawn from, and whether they are an agent rather than a person.
PriorityContact
Scheduled
SystemTime
A measurement of the system clock, useful for talking to external entities like the file system or other processes.

Enums§

Availability
CloseReason
Why the platform closed a notification the app showed, before the app took it back itself, as org.freedesktop.Notifications’ NotificationClosed names it.
Feature
NotifyError
Severity

Constants§

MAX_BUTTONS

Traits§

Notifier

Functions§

availability
available
publish_priority_contacts
Replace the people whose notifications break through Do Not Disturb with contacts. Only the Tilo shell takes such a list, and only from an app it launched as app_id (Feature::PriorityContacts). Blocks on the session bus: call it off the UI thread.
report_activation
set_activation_handler
set_close_handler
Call handler with the tag and reason of every notification whose tag starts with prefix that the platform closes, on whatever thread reports it. Replaces an earlier handler for prefix; where prefixes nest, the longest one wins.
system
This target’s notifications for the app app_id. A desktop attributes notifications to an app, so without an id (a tool, a test, the shell) they are unavailable there; a browser attributes them to the page’s origin and needs none.
unavailable
valid_activation
scheme:rest, the scheme as RFC 3986 spells it, without control characters or whitespace.

Type Aliases§

Unsupported