Skip to main content

Warning

Enum Warning 

Source
#[non_exhaustive]
pub enum Warning { Conflict { chord: String, contenders: Vec<String>, winner: String, }, UnknownAction { key: String, action: String, }, PrefixShadow { prefix: Vec<String>, prefix_action: String, shadowed: Vec<String>, shadowed_action: String, }, EmptySequence { action: String, }, SequenceShadow { chord: String, chord_action: String, sequence: Vec<String>, sequence_action: String, }, }
Expand description

A non-fatal problem found while building a Keymap.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Conflict

Two or more keys resolved to the same chord within one layer; the last one wins. A named layer’s conflict uses this same variant and carries no layer name, so two layers each conflicting on the same chord produce warnings indistinguishable on their own (the chord identifies the clash, not the layer). The same chord across different layers is an override, not a conflict, and is never reported.

Fields

§chord: String

The shared chord, in canonical form (e.g. "ctrl+a").

§contenders: Vec<String>

The competing action names, in file order.

§winner: String

The action name that won (the last binding for the chord).

§

UnknownAction

An action name in the config was not recognized by the resolver; the binding was skipped.

Fields

§key: String

The key string as written in the config. For a sequence, the canonical chords joined by spaces.

§action: String

The unrecognized action name.

§

PrefixShadow

Two sequence bindings share a prefix: the shorter (prefix) is a proper prefix of the longer (shadowed), so they cannot coexist without a timeout to tell them apart. The later-in-file binding was dropped to keep the sequence table prefix-free.

Fields

§prefix: Vec<String>

The shorter sequence, one canonical chord per element.

§prefix_action: String

The action bound to the shorter sequence.

§shadowed: Vec<String>

The longer sequence that shares the prefix, one chord per element.

§shadowed_action: String

The action bound to the longer sequence.

§

EmptySequence

A [[sequences]] entry had an empty keys array; it was skipped.

Fields

§action: String

The action name the empty sequence would have been bound to.

§

SequenceShadow

A single-chord [keys] binding collides with the first key of a [[sequences]] entry (e.g. "j" in [keys] and a sequence ["j", "k"]). Pressing that chord is then ambiguous — fire the single action now, or wait to see if the sequence continues? — and can only be disambiguated by a caller-side timeout (the vim jj case; see keymap-seq).

Unlike PrefixShadow, nothing is dropped: the chord stays in its layer (the global one — this is checked only against the global layer) and the sequence stays in BuildOutput::sequences (they are separate maps). This is purely an advisory that the caller composing the two maps must resolve the overlap.

Fields

§chord: String

The single chord, in canonical form (e.g. "j").

§chord_action: String

The action bound to the single chord.

§sequence: Vec<String>

One sequence the chord shadows — the lexicographically-first when it shadows several — one canonical chord per element (its first equals chord).

§sequence_action: String

The action bound to that sequence.

Implementations§

Source§

impl Warning

Source

pub fn kind(&self) -> WarningKind

Returns the category of this warning without the field data.

Useful for filtering: w.kind() == WarningKind::Conflict tests the category in a single comparison, even when the field details are not needed.

Trait Implementations§

Source§

impl Clone for Warning

Source§

fn clone(&self) -> Warning

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 Warning

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Warning

Source§

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

Formats the warning as a single human-readable line.

Display only — do not parse this output. The format is not stable and may change between minor versions; it is intended for logging and user messages, not machine consumption.

Source§

impl Eq for Warning

Source§

impl PartialEq for Warning

Source§

fn eq(&self, other: &Warning) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Warning

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.