Skip to main content

Module notification_queue

Module notification_queue 

Source
Expand description

Notification queue for managing multiple toast notifications. Notification queue manager for handling multiple concurrent toast notifications.

The queue system provides:

  • FIFO ordering with priority support (Urgent notifications jump ahead)
  • Maximum visible limit with automatic stacking
  • Content-based deduplication within a configurable time window
  • Automatic expiry processing via tick-based updates

§Example

let mut queue = NotificationQueue::new(QueueConfig::default());

// Push notifications
queue.push(Toast::new("File saved").icon(ToastIcon::Success), NotificationPriority::Normal);
queue.push(Toast::new("Error!").icon(ToastIcon::Error), NotificationPriority::Urgent);

// Process in your event loop
let actions = queue.tick(Duration::from_millis(16));
for action in actions {
    match action {
        QueueAction::Show(toast) => { /* render toast */ }
        QueueAction::Hide(id) => { /* remove toast */ }
    }
}

Structs§

NotificationQueue
Notification queue manager.
NotificationStack
Widget that renders the visible toasts in a queue.
QueueConfig
Configuration for the notification queue.
QueueStats
Queue statistics for monitoring and debugging.

Enums§

NotificationPriority
Priority level for notifications.
QueueAction
Actions returned by tick() to be processed by the application.