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§
- Notification
Queue - Notification queue manager.
- Notification
Stack - Widget that renders the visible toasts in a queue.
- Queue
Config - Configuration for the notification queue.
- Queue
Stats - Queue statistics for monitoring and debugging.
Enums§
- Notification
Priority - Priority level for notifications.
- Queue
Action - Actions returned by
tick()to be processed by the application.