pub trait Command: Copy + Sized {
// Required method
fn text(&self) -> &str;
// Provided methods
fn description(&self) -> Option<Cow<'static, str>> { ... }
fn info_ui(&self, _ui: &mut Ui) { ... }
fn formatted_kb_shortcut(&self, _ctx: &Context) -> Option<String> { ... }
}Expand description
Trait that must be implemented by command types
Required Methods§
Provided Methods§
Sourcefn description(&self) -> Option<Cow<'static, str>>
fn description(&self) -> Option<Cow<'static, str>>
A concise description shown inline, right of the name. Default none.
Sourcefn info_ui(&self, _ui: &mut Ui)
fn info_ui(&self, _ui: &mut Ui)
Detailed information for this command, rendered within the per-entry hover tooltip. Default renders nothing.
Sourcefn formatted_kb_shortcut(&self, _ctx: &Context) -> Option<String>
fn formatted_kb_shortcut(&self, _ctx: &Context) -> Option<String>
Optional keyboard shortcut for the command
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".