pub struct ActionHandlerContribution {
pub action_name: &'static str,
pub handler: ActionHandler,
}Expand description
A global (buffer-agnostic) action-handler
contribution declared by a mode via
Mode::action_handlers (SN.3c.0).
Use this for handlers whose body reads the active buffer /
cursor / services from the ActionContext at call time and
closes over no per-buffer state — they are registered ONCE at
boot (the host walks every mode’s action_handlers(),
resolves action_name → CommandId, and registers the
handler), and live for the app’s lifetime. The owning chord’s
per-keystroke mode gating (K.1.c) still scopes where the
chord fires; the handler itself is global.
Per-buffer handlers (tied to a live session / per-activation
state) must NOT use this — they register in
Mode::on_activate so their
ActionHandlerRegistration token drops with the mode’s Guard.
See feedback_effect_vocabulary_is_host_boundary.
Fields§
§action_name: &'static strCanonical command name (e.g. "action:snippet-expand").
The host resolves this to a CommandId via the command
registry at registration time.
handler: ActionHandlerThe handler closure registered for action_name.
Trait Implementations§
Source§impl Clone for ActionHandlerContribution
impl Clone for ActionHandlerContribution
Source§fn clone(&self) -> ActionHandlerContribution
fn clone(&self) -> ActionHandlerContribution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more