pub struct CommandInfo {
pub id: CommandId,
pub names: Vec<String>,
pub description: String,
pub args: Vec<ArgSpec>,
}Expand description
Command metadata for queries (no execution capability).
This is a snapshot of command information that can be serialized, cloned, and passed to modules without exposing the handler.
§Fields
id: Unique command identifier (module:name)names: User command aliases (e.g.,["w", "write"])description: Human-readable descriptionargs: Argument specifications
Fields§
§id: CommandIdUnique command identifier.
names: Vec<String>User command aliases (e.g., ["w", "write"]).
description: StringHuman-readable description.
args: Vec<ArgSpec>Argument specifications.
Implementations§
Source§impl CommandInfo
impl CommandInfo
Sourcepub fn from_command<C: Command + ?Sized>(cmd: &C) -> Self
pub fn from_command<C: Command + ?Sized>(cmd: &C) -> Self
Create from a Command trait implementor.
Extracts all metadata into owned types for safe passing across module boundaries.
Sourcepub const fn has_user_names(&self) -> bool
pub const fn has_user_names(&self) -> bool
Check if this command has any user-facing names.
Commands with names can be invoked from the command line (:w).
Commands without names are internal-only (keybinding commands).
Trait Implementations§
Source§impl Clone for CommandInfo
impl Clone for CommandInfo
Source§fn clone(&self) -> CommandInfo
fn clone(&self) -> CommandInfo
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 CommandInfo
impl RefUnwindSafe for CommandInfo
impl Send for CommandInfo
impl Sync for CommandInfo
impl Unpin for CommandInfo
impl UnsafeUnpin for CommandInfo
impl UnwindSafe for CommandInfo
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