pub struct CommandSpec {
pub id: CommandId,
pub label: String,
pub description: Option<String>,
pub shortcut_hint: Option<String>,
}Expand description
Human-readable metadata for a command.
Used by UI widgets (menu items, toolbar buttons, help overlays) to render labels, tooltips, and shortcut hints without knowing about egui or input handling.
Fields§
§id: CommandIdStable identifier.
label: StringShort display label shown in menus / buttons.
description: Option<String>Optional longer description for tooltips / help text.
shortcut_hint: Option<String>Human-readable shortcut hint (“F2”, “Ctrl+S”, …). Display-only;
actual shortcut matching lives in egui-command-binding.
Implementations§
Source§impl CommandSpec
impl CommandSpec
Sourcepub fn new(id: CommandId, label: impl Into<String>) -> Self
pub fn new(id: CommandId, label: impl Into<String>) -> Self
Minimal constructor — just an id and a label.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Builder: set description.
Sourcepub fn with_shortcut_hint(self, hint: impl Into<String>) -> Self
pub fn with_shortcut_hint(self, hint: impl Into<String>) -> Self
Builder: set the shortcut hint string.
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CommandSpec
impl RefUnwindSafe for CommandSpec
impl Send for CommandSpec
impl Sync for CommandSpec
impl Unpin for CommandSpec
impl UnsafeUnpin for CommandSpec
impl UnwindSafe for CommandSpec
Blanket Implementations§
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