Skip to main content

BoundCommand

Struct BoundCommand 

Source
pub struct BoundCommand {
    pub command: CommandInvocation,
    pub source: SourceLocation,
    pub layer: KeymapLayer,
    pub fall_through: bool,
}
Expand description

What the trie returns at a terminal node.

Carries enough provenance for :describe-key and enough information for the dispatcher to fire the binding:

  • command – the typed CommandInvocation to dispatch.
  • source – where the binding was registered (catalog entry, user init.rs:42, plugin foo.wit:7).
  • layer – priority tier for tie-break / shadowing.

Fields§

§command: CommandInvocation

The typed invocation the dispatcher runs when the chord resolves.

§source: SourceLocation

Where the binding was registered, for :describe-key provenance.

§layer: KeymapLayer

The layer the binding was created for. Set at construction by the caller; KeymapHandle::bind sets it to the layer it binds into.

§fall_through: bool

SN.3c.2b: :map-style augment-and-continue. When true, the dispatcher runs this binding’s action AND THEN re-resolves the same chord against the layers below this one (this binding’s layer mode peeled out of the active set), running the native binding too. false (default) = the binding fully handles the chord and stops, the normal shadowing behavior. Unlike vim’s :map recursion this is structurally bounded — each hop peels a layer, terminating at Builtin, so it cannot loop. Declared on the owning KeymapEntry; the host owns the re-resolution.

Implementations§

Source§

impl BoundCommand

Source

pub fn from_invocation( command: CommandInvocation, source: SourceLocation, layer: KeymapLayer, ) -> Self

Construct a binding that dispatches via the CommandInvocation. fall_through defaults to false (the binding fully handles its chord); use Self::with_fall_through to opt into augment-and-continue.

Source

pub fn with_fall_through(self, fall_through: bool) -> Self

SN.3c.2b: set the augment-and-continue flag (see BoundCommand::fall_through). Builder form so the many existing from_invocation call sites stay source-compatible.

Trait Implementations§

Source§

impl Clone for BoundCommand

Source§

fn clone(&self) -> BoundCommand

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BoundCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more