pub struct Notification { /* private fields */ }Expand description
Provides a builder API and contains relevant notification info.
§Examples
use dioxus_notification::Notification;
Notification::new()
.app_name("dioxus test".to_string())
.summary("hi, this is dioxus test".to_string())
.body("lorem ipsum??".to_string())
.show()
.unwrap();
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn show(&self) -> Result<(), NotificationError>
pub fn show(&self) -> Result<(), NotificationError>
Show the final notification.
Sourcepub fn app_name(&mut self, value: impl ToString) -> &mut Self
pub fn app_name(&mut self, value: impl ToString) -> &mut Self
Set the application’s name for the notification.
Sourcepub fn summary(&mut self, value: impl ToString) -> &mut Self
pub fn summary(&mut self, value: impl ToString) -> &mut Self
Set the summary content of the notification.
Sourcepub fn body(&mut self, value: impl ToString) -> &mut Self
pub fn body(&mut self, value: impl ToString) -> &mut Self
Set the body content of the notification.
Sourcepub fn icon_path(&mut self, value: impl AsRef<Path>) -> &mut Self
pub fn icon_path(&mut self, value: impl AsRef<Path>) -> &mut Self
Set full path to image.
Not supported on MacOS.
Sourcepub fn timeout(&mut self, value: NotificationTimeout) -> &mut Self
pub fn timeout(&mut self, value: NotificationTimeout) -> &mut Self
Set a timeout for when the notification should hide.
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