Struct termux_notification::TermuxNotification
source · pub struct TermuxNotification { /* private fields */ }Expand description
Builder for termux-notification command
Implementations§
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
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 TermuxNotification
impl Debug for TermuxNotification
source§impl Default for TermuxNotification
impl Default for TermuxNotification
source§fn default() -> TermuxNotification
fn default() -> TermuxNotification
Returns the “default value” for a type. Read more
source§impl PartialEq for TermuxNotification
impl PartialEq for TermuxNotification
source§fn eq(&self, other: &TermuxNotification) -> bool
fn eq(&self, other: &TermuxNotification) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for TermuxNotification
impl StructuralPartialEq for TermuxNotification
Auto Trait Implementations§
impl RefUnwindSafe for TermuxNotification
impl Send for TermuxNotification
impl Sync for TermuxNotification
impl Unpin for TermuxNotification
impl UnwindSafe for TermuxNotification
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