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_memorydirectly 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 backingNotificationLogand the bell-icon badge.- center_
button NotificationCenterButton— bell icon with an unread-count badge that opens aNotificationLogpopover when clicked.- log
NotificationLog— a scrollable, day-bucketed list of archived notifications.- log_
dialog NotificationLogDialog— one-line modal preset wrappingNotificationLoginside aModalContainer.
Structs§
- Archived
Action - A single action stored alongside an archived notification entry. Only
re-invokable from
NotificationLogwhenintent_nameis set — actions whose live closure has torn down render as inert descriptive labels. - Notification
Entry - A single archived notification entry rendered by
NotificationLogand persisted underNotificationArchive::Persistent. Carries plain owned fields only — no closures, noRc<dyn Fn>— so it isSerialize-friendly. - Notification
Update - One in-place mutation applied when a
Toastwith the sameidas an existing entry is presented again. The archive merges these onto the existing row — the “Uploading 3 of 7 → Upload complete” pattern.
Enums§
- Archived
Action Style - Visual presentation of an archived action button. Maps one-to-one to
ToastActionStyle; re-declared as a self-containedSerialize-friendly enum so the archive type does not depend onButtonVariant.