egui-command
egui-command is the pure command-model layer used by SAide's egui stack.
It provides stable command identifiers, display metadata, runtime availability
state, and trigger payload types without depending on egui itself.
Core types
CommandId— stable hash-backed identifier for an app-defined command valueCommandSpec— user-facing metadata such as label, description, and shortcut hintCommandState— runtime availability (Enabled,Disabled,Hidden)CommandRegistry<C>— registry for command specs and states keyed byCommandIdCommandTriggered/CommandSource— payloads for command dispatch systems
CommandRegistry quick start
use ;
let mut registry = new
.with
.with;
assert_eq!;
assert_eq!;
registry.set_state;
assert_eq!;
let id = new;
assert_eq!;
API summary
Register commands
CommandRegistry::new()creates an empty registryregister(cmd, spec)inserts or replaces a command specwith(cmd, spec)is the builder-style equivalent for chained construction
Query metadata and state
spec(cmd)/spec_by_id(id)returnOption<&CommandSpec>state(cmd)/state_by_id(id)returnOption<CommandState>iter_specs()iterates over all registered command specs
Update runtime state
set_state(cmd, state)updates a registered command's stateset_state_by_id(id, state)performs the same update via rawCommandIdspec_by_id_mut(id)allows in-place metadata edits such as filling shortcut hints
egui-command-binding integrates with this registry via
ShortcutManager::fill_shortcut_hints, allowing the egui input layer to keep
display-only shortcut text synchronized with registered commands.