Skip to main content

notifications/
lib.rs

1//! # notifications
2//! `notifications` provides a notification daemon which receives and manages notifications sent by
3//! applications on GNU/Linux desktops that follow XDG Desktop Notifications Specification.
4//!
5//! ## Example
6//! ```rust
7//! use notifications::NotificationService;
8//!
9//! # let rt = tokio::runtime::Runtime::new().unwrap();
10//! # rt.block_on(async {
11//!
12//! let service = NotificationService::new(None).unwrap();
13//! service.run().await.unwrap();
14//!
15//! service.on_notified(|(id, notification, replace)| println!("New
16//! notification! id: {}, summary: {}, replaces old one: {}", id, notification.summary(), replace));
17//!
18//! service.on_notification_closed(|(id, reason)| println!("Notification closed! id: {},
19//! reason: {:?}", id, reason));
20//! # });
21//!
22//! ```
23
24#![warn(missing_docs)]
25
26mod action;
27mod close_reason;
28mod data;
29mod dbus;
30mod error;
31mod file_utils;
32mod notification;
33mod private_prelude;
34mod service;
35mod settings;
36mod urgency;
37
38pub use action::ActionHandle;
39pub use close_reason::CloseReason;
40pub use error::{Error, Result};
41pub use notification::NotificationHandle;
42pub use service::NotificationService;
43pub use settings::Settings;
44pub use urgency::Urgency;