Skip to main content

Crate notifications

Crate notifications 

Source
Expand description

§notifications

notifications provides a notification daemon which receives and manages notifications sent by applications on GNU/Linux desktops that follow XDG Desktop Notifications Specification.

§Example

use notifications::NotificationService;


let service = NotificationService::new(None).unwrap();
service.run().await.unwrap();

service.on_notified(|(id, notification, replace)| println!("New
notification! id: {}, summary: {}, replaces old one: {}", id, notification.summary(), replace));

service.on_notification_closed(|(id, reason)| println!("Notification closed! id: {},
reason: {:?}", id, reason));

Structs§

ActionHandle
A handle which represents a notification action.
NotificationHandle
A handle to a notification.
NotificationService
A notification daemon that follows XDG Desktop Notifications Specification.
Settings
Settings for NotificationService.

Enums§

CloseReason
A reason why the notification is closed.
Error
Enum representing possible errors to happen during the usage of crate::NotificationService.
Urgency
The urgency level of the notification.

Type Aliases§

Result
Alias for a std::result::Result with the error type crate::Error.