Skip to main content

Module notification

Module notification 

Source
Expand description

Persistent notification archive — the storage and data-model layer backing NotificationLog, NotificationCenterButton, and NotificationLogDialog.

Every toast presented through the toast registry is mirrored into a NotificationArchiveModel when archiving is enabled via ToastInstallOptions::archive. The model is a ListModel<NotificationEntry> plus an unread-count signal — shaped for one-line binding to the notification UI family. Two storage variants are available: an in-memory session-only ring buffer (NotificationArchive::InMemory) and a file-backed persistent store (NotificationArchive::Persistent) that survives app restarts. Action callbacks attached via raw closures are lost on archival; actions that should remain re-invokable from the log carry an intent_name that the log replays through ctx.send_intent(...).

§When to use

  • Pair with TeksiloAppBuilder::install_toast_default() to get the full bell-button + log + persistence stack for free.
  • Construct NotificationArchiveModel::in_memory directly in tests or custom toast setups.
// In app boot, after install_toast:
let archive = ctx.app_state::<Rc<RefCell<NotificationArchiveModel>>>().unwrap();
let log = NotificationLog::new(archive.clone());

Re-exports§

pub use archive::ARCHIVE_FILE_NAME;
pub use archive::DEFAULT_ARCHIVE_LIMIT;
pub use archive::NotificationArchive;
pub use archive::NotificationArchiveError;
pub use archive::NotificationArchiveModel;
pub use center_button::NotificationCenterButton;
pub use log::NotificationLog;
pub use log_dialog::NotificationLogDialog;

Modules§

archive
NotificationArchiveModel — the persistent list backing NotificationLog and the bell-icon badge.
center_button
NotificationCenterButton — bell icon with an unread-count badge that opens a NotificationLog popover when clicked.
log
NotificationLog — a scrollable, day-bucketed list of archived notifications.
log_dialog
NotificationLogDialog — one-line modal preset wrapping NotificationLog inside a ModalContainer.

Structs§

ArchivedAction
A single action stored alongside an archived notification entry. Only re-invokable from NotificationLog when intent_name is set — actions whose live closure has torn down render as inert descriptive labels.
NotificationEntry
A single archived notification entry rendered by NotificationLog and persisted under NotificationArchive::Persistent. Carries plain owned fields only — no closures, no Rc<dyn Fn> — so it is Serialize-friendly.
NotificationUpdate
One in-place mutation applied when a Toast with the same id as an existing entry is presented again. The archive merges these onto the existing row — the “Uploading 3 of 7 → Upload complete” pattern.

Enums§

ArchivedActionStyle
Visual presentation of an archived action button. Maps one-to-one to ToastActionStyle; re-declared as a self-contained Serialize-friendly enum so the archive type does not depend on ButtonVariant.