pub struct CommandMeta {
pub title: Arc<str>,
pub description: Option<Arc<str>>,
pub category: Option<Arc<str>>,
pub keywords: Vec<Arc<str>>,
pub default_keybindings: Vec<DefaultKeybinding>,
pub when: Option<WhenExpr>,
pub os_action: Option<OsAction>,
pub scope: CommandScope,
pub hidden: bool,
pub repeatable: bool,
}Expand description
Metadata describing a command (title, keybindings, visibility, routing scope).
Fields§
§title: Arc<str>§description: Option<Arc<str>>§category: Option<Arc<str>>§keywords: Vec<Arc<str>>§default_keybindings: Vec<DefaultKeybinding>§when: Option<WhenExpr>§os_action: Option<OsAction>§scope: CommandScope§repeatable: boolImplementations§
Source§impl CommandMeta
impl CommandMeta
pub fn new(title: impl Into<Arc<str>>) -> Self
pub fn with_description(self, description: impl Into<Arc<str>>) -> Self
pub fn with_category(self, category: impl Into<Arc<str>>) -> Self
pub fn with_keywords( self, keywords: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> Self
pub fn with_default_keybindings( self, bindings: impl IntoIterator<Item = DefaultKeybinding>, ) -> Self
pub fn with_when(self, when: WhenExpr) -> Self
pub fn with_os_action(self, os_action: OsAction) -> Self
pub fn with_scope(self, scope: CommandScope) -> Self
pub fn repeatable(self) -> Self
Trait Implementations§
Source§impl Clone for CommandMeta
impl Clone for CommandMeta
Source§fn clone(&self) -> CommandMeta
fn clone(&self) -> CommandMeta
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 CommandMeta
impl RefUnwindSafe for CommandMeta
impl Send for CommandMeta
impl Sync for CommandMeta
impl Unpin for CommandMeta
impl UnsafeUnpin for CommandMeta
impl UnwindSafe for CommandMeta
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