Trait zng::event::CommandNameExt

source ·
pub trait CommandNameExt {
    // Required methods
    fn name(self) -> Box<dyn VarBoxed<Txt>>;
    fn init_name(self, name: impl Into<Txt>) -> Self;
    fn name_with_shortcut(self) -> Box<dyn VarBoxed<Txt>>
       where Self: CommandShortcutExt;
}
Expand description

Adds the name command metadata.

Required Methods§

source

fn name(self) -> Box<dyn VarBoxed<Txt>>

Gets a read-write variable that is the display name for the command.

source

fn init_name(self, name: impl Into<Txt>) -> Self

Sets the initial name if it is not set.

source

fn name_with_shortcut(self) -> Box<dyn VarBoxed<Txt>>
where Self: CommandShortcutExt,

Gets a read-only variable that formats the name and first shortcut in the following format: name (first_shortcut) Note: If no shortcuts are available this method returns the same as name

Object Safety§

This trait is not object safe.

Implementors§