Module notify

Source
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:

  1. Display rich, actionable notifications when things go wrong
  2. Categorize notifications by severity for appropriate presentation
  3. 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.