pub struct Command {
pub name: &'static str,
pub arguments: Vec<&'static str>,
pub description: &'static str,
pub documentation: &'static str,
pub scope: CommandScope,
pub action: CommandAction,
}Expand description
Represents a sued editing command.
Commands can be defined anywhere in the program, but must be added to a CommandRegistry to make them accessible.
Fields§
§name: &'static strThe name of the command to execute using run_sued_command or in the REPL. This should ideally be lowercase with no separations (no camelCase or snake_case).
arguments: Vec<&'static str>The arguments that the command takes. This is PURELY VISUAL and does not control the arguments the command uses. You are expected to manually handle command-line arguments in the action definition.
description: &'static strA description of what the command does.
This will be printed in the ~help command.
documentation: &'static strA more expansive description of what the command does.
This will be printed in the ~help <command> and ~doc <command>
commands.
scope: CommandScopeThe scope of the command. For more information about command scope, see the CommandScope enum.
action: CommandActionThe action that running the command uses. For more information about command actions, see the CommandAction struct.
Implementations§
Trait Implementations§
Source§impl Ord for Command
impl Ord for Command
Source§impl PartialOrd for Command
impl PartialOrd for Command
impl Eq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl !Send for Command
impl !Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more