pub struct Settings { /* private fields */ }Expand description
Settings for NotificationService.
This struct provides methods to change behavior of some parts of the service.
Settings uses shared ownership for the data, so cloning it is a cheap operation.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn follow_xdg_timeout(&self) -> bool
pub fn follow_xdg_timeout(&self) -> bool
Returns whether to respect XDG Specification for timeout.
If set to false, notifications never expire despite the value of NotificationHandle::timeout().
Otherwise, behavior is based on notification’s timeout:
-1- timeout value is taken fromSettings::default_timeout().0- the notification never expire>=0- this timeout is used to expire the notification
Default: True.
Sourcepub fn default_timeout(&self) -> u32
pub fn default_timeout(&self) -> u32
Returns the default timeout which is used when a notification doesn’t specify timeout (-1).
Has effect only if Settings::follow_xdg_timeout() and Settings::expire_by_default() are both true.
Default: 3000.
Sourcepub fn expire_by_default(&self) -> bool
pub fn expire_by_default(&self) -> bool
Returns whether to expire notifications if the timeout is not specified (when timeout is -1).
If true, notifications expire after the timeout defined in Settings::default_timeout().
Default: false.
Sourcepub fn set_follow_xdg_timeout(&self, value: bool)
pub fn set_follow_xdg_timeout(&self, value: bool)
Sets Settings::follow_xdg_timeout() setting.
Sourcepub fn set_default_timeout(&self, value: u32)
pub fn set_default_timeout(&self, value: u32)
Sets Settings::default_timeout() setting.
Sourcepub fn set_expire_by_default(&self, value: bool)
pub fn set_expire_by_default(&self, value: bool)
Sets Settings::expire_by_default() setting.