pub struct Action {
pub meta: Meta,
pub command: String,
pub args: Value,
pub style: ActionStyle,
pub confirm: Option<String>,
pub confirmation: Option<Confirmation>,
}Expand description
A command and its argument template: a button or a link. The
command’s declaration gives the title, icon, keys and when the
action does not set, so an action and the palette entry are one.
Fields§
§meta: Meta§command: String§args: Value${field}, ${row.<key>}, ${selection} (template).
style: ActionStyle§confirm: Option<String>A confirm hook by name.
confirmation: Option<Confirmation>A confirmation asked before the command runs (its texts may name
the form’s and the row’s values, ${row.name}).
Implementations§
Source§impl Action
impl Action
pub fn command(command: &str) -> Action
pub fn title(self, title: &str) -> Action
pub fn args(self, args: Json) -> Action
pub fn primary(self) -> Action
pub fn danger(self) -> Action
pub fn confirm(self, hook: &str) -> Action
Sourcepub fn confirmation(self, confirmation: Confirmation) -> Action
pub fn confirmation(self, confirmation: Confirmation) -> Action
Asks this before running.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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