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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more