pub struct Command {
pub id: &'static str,
pub label: String,
pub group: &'static str,
pub keywords: Vec<&'static str>,
pub shortcut: Option<&'static str>,
pub enabled: bool,
pub icon: Option<&'static str>,
}Expand description
A user-invokable action. The same command appears in context menus, the command palette, and menu bars — and can be fired by id from a headless test.
Fields§
§id: &'static strStable, headless-addressable id ("copy", "case.new").
label: StringShown to the user.
group: &'static strSection heading / top-level menu name ("Edit", "View", "Case").
keywords: Vec<&'static str>Extra search terms (matched by the palette, never shown).
shortcut: Option<&'static str>A human-readable shortcut hint shown right-aligned ("Ctrl+C"). Display
only — the host owns the real key binding.
enabled: boolDisabled commands are dimmed, unclickable, and never matched by the palette.
icon: Option<&'static str>Optional leading glyph (e.g. an egui-phosphor icon char).
Implementations§
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more