pub struct CommandSpec {
pub name: String,
pub about: String,
pub version: Option<String>,
pub author: Option<String>,
pub args: Vec<ArgSpec>,
pub subcommands: Vec<CommandSpec>,
}Expand description
Command specification returned by plugin’s manifest() function
Fields§
§name: StringCommand name (used for routing, e.g., “hello” or “db:create”)
about: StringShort description for help text
version: Option<String>Plugin version (semver)
Plugin author
args: Vec<ArgSpec>Argument specifications
subcommands: Vec<CommandSpec>Nested subcommands
Implementations§
Source§impl CommandSpec
impl CommandSpec
Sourcepub fn new(name: impl Into<String>, about: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, about: impl Into<String>) -> Self
Create a new command spec
Sourcepub fn subcommand(self, cmd: CommandSpec) -> Self
pub fn subcommand(self, cmd: CommandSpec) -> Self
Add a subcommand
Trait Implementations§
Source§impl Clone for CommandSpec
impl Clone for CommandSpec
Source§fn clone(&self) -> CommandSpec
fn clone(&self) -> CommandSpec
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 moreSource§impl Debug for CommandSpec
impl Debug for CommandSpec
Source§impl<'de> Deserialize<'de> for CommandSpec
impl<'de> Deserialize<'de> for CommandSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CommandSpec
impl RefUnwindSafe for CommandSpec
impl Send for CommandSpec
impl Sync for CommandSpec
impl Unpin for CommandSpec
impl UnwindSafe for CommandSpec
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