pub struct Notification {Show 23 fields
pub id: u32,
pub app_name: Property<Option<String>>,
pub replaces_id: Property<Option<u32>>,
pub app_icon: Property<Option<String>>,
pub summary: Property<String>,
pub body: Property<Option<String>>,
pub actions: Property<Vec<Action>>,
pub default_action: Property<Option<Action>>,
pub hints: Property<Option<NotificationHints>>,
pub expire_timeout: Property<Option<u32>>,
pub urgency: Property<Urgency>,
pub category: Property<Option<Category>>,
pub timestamp: Property<DateTime<Utc>>,
pub image_path: Property<Option<String>>,
pub desktop_entry: Property<Option<String>>,
pub is_transient: Property<bool>,
pub is_resident: Property<bool>,
pub sound_file: Property<Option<String>>,
pub sound_name: Property<Option<String>>,
pub suppress_sound: Property<bool>,
pub x: Property<Option<i32>>,
pub y: Property<Option<i32>>,
pub action_icons: Property<bool>,
/* private fields */
}Expand description
A desktop notification.
Each notification displayed is allocated a unique ID by the server. This is unique within the session. While the notification server is running, the ID will not be recycled unless the capacity of a uint32 is exceeded.
Fields§
§id: u32The ID of the notification
app_name: Property<Option<String>>The optional name of the application sending the notification. This should be the application’s formal name, rather than some sort of ID. An example would be “FredApp E-Mail Client,” rather than “fredapp-email-client.”
replaces_id: Property<Option<u32>>An optional ID of an existing notification that this notification is intended to replace.
app_icon: Property<Option<String>>The notification icon.
summary: Property<String>This is a single line overview of the notification. For instance, “You have mail” or “A friend has come online”. It should generally not be longer than 40 characters, though this is not a requirement, and server implementations should word wrap if necessary. The summary must be encoded using UTF-8.
body: Property<Option<String>>This is a multi-line body of text. Each line is a paragraph, server implementations are free to word wrap them as they see fit.
The body may contain simple markup as specified in Markup. It must be encoded using UTF-8.
If the body is omitted, just the summary is displayed.
actions: Property<Vec<Action>>Available actions for this notification.
Each action has an identifier and a human-readable label. The “default” action is typically invoked when clicking the notification body.
default_action: Property<Option<Action>>The default action, triggered when clicking the notification body.
hints: Property<Option<NotificationHints>>Hints are a way to provide extra data to a notification server that the server may be able to make use of.
Neither clients nor notification servers are required to support any hints. Both sides should assume that hints are not passed, and should ignore any hints they do not understand.
expire_timeout: Property<Option<u32>>The timeout time in milliseconds since the display of the notification at which the notification should automatically close.
None = server decides, Some(0) = never expires, Some(ms) = timeout in milliseconds.
urgency: Property<Urgency>The urgency level.
category: Property<Option<Category>>The type of notification this is.
timestamp: Property<DateTime<Utc>>When the notification was created.
image_path: Property<Option<String>>Path to an image file from hints.
desktop_entry: Property<Option<String>>Desktop entry name of the application.
is_transient: Property<bool>Whether the notification should be transient (not persisted).
is_resident: Property<bool>Whether the notification stays after action invocation.
sound_file: Property<Option<String>>Path to a sound file to play when the notification pops up.
sound_name: Property<Option<String>>A themeable named sound to play when the notification pops up.
suppress_sound: Property<bool>Whether to suppress playing sounds for this notification.
x: Property<Option<i32>>X position hint for notification placement.
y: Property<Option<i32>>Y position hint for notification placement.
action_icons: Property<bool>Whether action IDs should be interpreted as icon names.
Implementations§
Source§impl Notification
impl Notification
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more