pub struct ActionSpec {
pub apply: Arc<dyn Fn(&ActionContext) -> GrammarResult<Effect> + Send + Sync>,
pub args_schema: Vec<ArgSpec>,
}Expand description
A registered free-form action: a command with no grammar role, usually bound to a chord.
Registered through CommandRegistry::register_action (or
CommandRegistry::register_plugin_action). Most return
Effect::AppAction(..) for the host to apply; mode-owned actions are
registered by their mode’s crate, not the host.
Fields§
§apply: Arc<dyn Fn(&ActionContext) -> GrammarResult<Effect> + Send + Sync>The evaluator: returns the Effect the host applies.
args_schema: Vec<ArgSpec>Per-positional-argument metadata (DESIGN.md §B.1). Empty for actions without args (the common case for chord bindings – the args slot is reserved for future captured-char / numeric-param variants in slice 8.i.2-3).
Trait Implementations§
Source§impl Clone for ActionSpec
impl Clone for ActionSpec
Source§fn clone(&self) -> ActionSpec
fn clone(&self) -> ActionSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ActionSpec
impl !UnwindSafe for ActionSpec
impl Freeze for ActionSpec
impl Send for ActionSpec
impl Sync for ActionSpec
impl Unpin for ActionSpec
impl UnsafeUnpin for ActionSpec
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