#[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
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>
impl<A> BuildOutput<A>
Sourcepub fn global(&self) -> &Keymap<A>
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>
impl<A: Clone> Clone for BuildOutput<A>
Source§fn clone(&self) -> BuildOutput<A>
fn clone(&self) -> BuildOutput<A>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more