pub struct Action { /* private fields */ }Expand description
A button the user can tap on a notification, belonging to an ActionType.
It maps to a UNNotificationAction on iOS. On Android only the identifier, the title
and the input flag are used, on desktop only the identifier and the title.
Use Action::builder to construct one.
Implementations§
Source§impl Action
impl Action
Sourcepub fn builder(id: impl Into<String>, title: impl Into<String>) -> ActionBuilder
pub fn builder(id: impl Into<String>, title: impl Into<String>) -> ActionBuilder
Creates a builder for an action with the given identifier and button title.
All the optional settings default to false or None;
call ActionBuilder::build to get the Action.
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The identifier of this action, reported back when the user triggers it.
Sourcepub fn requires_authentication(&self) -> bool
pub fn requires_authentication(&self) -> bool
Whether the device must be unlocked for the action to run.
Only used on iOS.
Sourcepub fn foreground(&self) -> bool
pub fn foreground(&self) -> bool
Whether the app is brought to the foreground when the action is triggered.
Only used on iOS.
Sourcepub fn destructive(&self) -> bool
pub fn destructive(&self) -> bool
Whether the action is displayed as destructive, usually in red.
Only used on iOS.
The text displayed on the button that submits the text input.
Only used on iOS.
Sourcepub fn input_placeholder(&self) -> Option<&str>
pub fn input_placeholder(&self) -> Option<&str>
The placeholder displayed on the empty text input field.
Only used on iOS.