pub struct TermuxNotification { /* private fields */ }Expand description
Builder for termux-notification command
Implementations§
Source§impl TermuxNotification
impl TermuxNotification
Sourcepub fn on_delete_fn<F>(&mut self, f: F) -> &mut Self
pub fn on_delete_fn<F>(&mut self, f: F) -> &mut Self
Action to execute when the the notification is cleared
§Panics
Panics if notification id not provided
Source§impl TermuxNotification
impl TermuxNotification
pub fn new() -> Self
Sourcepub fn id(&mut self, id: impl Into<String>) -> &mut Self
pub fn id(&mut self, id: impl Into<String>) -> &mut Self
Notification id (will overwrite any previous notification with the same id)
Sourcepub fn content(&mut self, content: impl Into<String>) -> &mut Self
pub fn content(&mut self, content: impl Into<String>) -> &mut Self
Content to show in the notification.
Sourcepub fn icon(&mut self, icon: impl Into<String>) -> &mut Self
pub fn icon(&mut self, icon: impl Into<String>) -> &mut Self
Set the icon that shows up in the status bar.
View available icons at https://material.io/resources/icons/
(default icon: event_note)
Sourcepub fn alert_once(&mut self, alert_once: bool) -> &mut Self
pub fn alert_once(&mut self, alert_once: bool) -> &mut Self
Do not alert when the notification is edited
Sourcepub fn action(&mut self, action: impl Into<String>) -> &mut Self
pub fn action(&mut self, action: impl Into<String>) -> &mut Self
Action to execute when pressing the notification
Sourcepub fn on_delete(&mut self, on_delete: impl Into<String>) -> &mut Self
pub fn on_delete(&mut self, on_delete: impl Into<String>) -> &mut Self
Action to execute when the the notification is cleared
Text and action for first notification button
Text and action for second notification button
Text and action for third notification button
Sourcepub fn show(&self) -> Result<RemoveHandle>
pub fn show(&self) -> Result<RemoveHandle>
Shows notification via termux-notification command
§Errors
Returns an error if command status not success
Sourcepub fn to_command(&self) -> Command
pub fn to_command(&self) -> Command
Builds termux-notification command
Trait Implementations§
Source§impl Clone for TermuxNotification
impl Clone for TermuxNotification
Source§fn clone(&self) -> TermuxNotification
fn clone(&self) -> TermuxNotification
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more