Skip to main content

BuildOutput

Struct BuildOutput 

Source
#[non_exhaustive]
pub struct BuildOutput<A> { pub layers: BTreeMap<String, Keymap<A>>, pub sequences: SequenceKeymap<A>, pub warnings: Vec<Warning>, pub unbinds: BTreeMap<String, Vec<KeyInput>>, }
Expand description

The result of a successful build: the named layers plus any non-fatal warnings.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§layers: BTreeMap<String, Keymap<A>>

The assembled layers, keyed by name. The top-level [keys] table builds the GLOBAL_LAYER layer (always present, even when empty); each [layers.<name>] table builds the layer of that name. Within any one layer, conflicting chords resolve to the last binding. The same chord bound in two different layers is not a conflict — it is the override the caller composes with keymap_core::resolve_layered, so this crate never reports across layer boundaries.

Always contains the "global" key, so layers.len() counts the global layer even when the config bound nothing in it.

§sequences: SequenceKeymap<A>

The assembled sequence map, built from the top-level [[sequences]] tables. Sequences are not layered (they belong to the global config); empty when the config has no sequences.

§warnings: Vec<Warning>

Problems that did not prevent building (conflicts, unknown actions, prefix shadows), in the order they were first seen.

§unbinds: BTreeMap<String, Vec<KeyInput>>

Chords declared as tombstones (= false) in the config, grouped by layer name. A tombstone records an intent to remove a chord from a base keymap; the chord is not present in layers (it has no action), but is carried here so merge can apply the removal to a base BuildOutput.

Empty when the config has no = false declarations.

Implementations§

Source§

impl<A> BuildOutput<A>

Source

pub fn global(&self) -> &Keymap<A>

The GLOBAL_LAYER layer (built from the top-level [keys] table).

This is the convenience accessor for the common case of a single, unlayered keymap: out.global() is exactly &out.layers[GLOBAL_LAYER]. A config with no [keys] table yields an empty global layer, not an absent one.

§Panics

Never in practice: from_str always inserts the global layer (empty if the config had no [keys] table), so the lookup cannot miss.

Trait Implementations§

Source§

impl<A: Clone> Clone for BuildOutput<A>

Source§

fn clone(&self) -> BuildOutput<A>

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<A: Debug> Debug for BuildOutput<A>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A> Freeze for BuildOutput<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for BuildOutput<A>
where A: RefUnwindSafe,

§

impl<A> Send for BuildOutput<A>
where A: Send,

§

impl<A> Sync for BuildOutput<A>
where A: Sync,

§

impl<A> Unpin for BuildOutput<A>
where A: Unpin,

§

impl<A> UnsafeUnpin for BuildOutput<A>
where A: UnsafeUnpin,

§

impl<A> UnwindSafe for BuildOutput<A>

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.

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.