Struct win7_notifications::Notification
source · #[non_exhaustive]pub struct Notification {
pub icon: Option<Vec<u8>>,
pub icon_width: u32,
pub icon_height: u32,
pub appname: String,
pub summary: String,
pub body: String,
pub timeout: Timeout,
pub silent: bool,
}
Expand description
Describes The notification
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.icon: Option<Vec<u8>>
§icon_width: u32
§icon_height: u32
§appname: String
§summary: String
§body: String
§timeout: Timeout
§silent: bool
Implementations§
source§impl Notification
impl Notification
sourcepub fn new() -> Notification
pub fn new() -> Notification
Constructs a new Notification.
Most fields are empty by default, only appname
is initialized with the name of the current
executable.
sourcepub fn appname(&mut self, appname: &str) -> &mut Notification
pub fn appname(&mut self, appname: &str) -> &mut Notification
Overwrite the appname field used for Notification.
sourcepub fn summary(&mut self, summary: &str) -> &mut Notification
pub fn summary(&mut self, summary: &str) -> &mut Notification
Set the summary
.
Often acts as title of the notification. For more elaborate content use the body
field.
sourcepub fn body(&mut self, body: &str) -> &mut Notification
pub fn body(&mut self, body: &str) -> &mut Notification
Set the content of the body
field.
Multiline textual content of the notification. Each line should be treated as a paragraph. html markup is not supported.
sourcepub fn icon(
&mut self,
rgba: Vec<u8>,
width: u32,
height: u32,
) -> &mut Notification
pub fn icon( &mut self, rgba: Vec<u8>, width: u32, height: u32, ) -> &mut Notification
Set the icon
field from 32bpp RGBA data.
The length of rgba
must be divisible by 4, and width * height
must equal
rgba.len() / 4
. Otherwise, this will panic.
sourcepub fn timeout(&mut self, timeout: Timeout) -> &mut Notification
pub fn timeout(&mut self, timeout: Timeout) -> &mut Notification
Set the timeout
field.
sourcepub fn silent(&mut self, silent: bool) -> &mut Notification
pub fn silent(&mut self, silent: bool) -> &mut Notification
Set the silent
field.
Trait Implementations§
source§impl Clone for Notification
impl Clone for Notification
source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Notification
impl Debug for Notification
source§impl Default for Notification
impl Default for Notification
source§fn default() -> Notification
fn default() -> Notification
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnwindSafe for Notification
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)