Expand description
§Notification Integration for Errors
This module provides the Notifiable trait and Notification struct,
enabling errors to be displayed as desktop notifications.
§Design Rationale
Errors in a desktop shell should be visible to users, not buried in logs.
By implementing Notifiable on error types, we can:
- Display rich, actionable notifications when things go wrong
- Categorize notifications by severity for appropriate presentation
- Provide suggestions that help users fix problems themselves
§Integration Flow
ConfigError implements Notifiable
│
▼
error.to_notification()
│
▼
NotifyPort::send(notification)
│
▼
D-Bus adapter → Desktop notification service§Example
ⓘ
use fernctl::error::{ConfigError, Notifiable, Notification};
let error = ConfigError::InvalidColor {
value: "#gg0000".to_string(),
span: None,
source_code: None,
};
// Convert to notification
let notification = error.to_notification();
// Send via notification port
notify_port.send(notification)?;Modules§
- system_
time_ 🔒serde - Serde support for
SystemTime.
Structs§
- Notification
- A notification ready to be sent to the desktop notification service.
Traits§
- Notifiable
- Trait for types that can be converted to user-facing notifications.