pub struct CommandDefinition {
pub id: String,
pub name: String,
pub description: String,
pub command: String,
pub arguments: Vec<CommandArgument>,
pub enabled: bool,
pub inject_output: bool,
pub timeout_seconds: u64,
pub tags: Vec<String>,
pub metadata: HashMap<String, String>,
}Expand description
A custom command definition
Fields§
§id: StringUnique identifier for the command
name: StringHuman-readable name
description: StringDescription of what the command does
command: StringThe shell command to execute (supports templates)
arguments: Vec<CommandArgument>Command arguments with templates
enabled: boolWhether the command is enabled
inject_output: boolWhether to inject output into chat
timeout_seconds: u64Timeout in seconds (0 = no timeout)
Tags for categorization
metadata: HashMap<String, String>Custom metadata
Implementations§
Source§impl CommandDefinition
impl CommandDefinition
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
command: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, command: impl Into<String>, ) -> Self
Create a new command definition
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn with_argument(self, argument: CommandArgument) -> Self
pub fn with_argument(self, argument: CommandArgument) -> Self
Add an argument
Sourcepub fn with_inject_output(self, inject: bool) -> Self
pub fn with_inject_output(self, inject: bool) -> Self
Set whether to inject output
Sourcepub fn with_timeout(self, seconds: u64) -> Self
pub fn with_timeout(self, seconds: u64) -> Self
Set timeout
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Set enabled state
Trait Implementations§
Source§impl Clone for CommandDefinition
impl Clone for CommandDefinition
Source§fn clone(&self) -> CommandDefinition
fn clone(&self) -> CommandDefinition
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 CommandDefinition
impl Debug for CommandDefinition
Source§impl<'de> Deserialize<'de> for CommandDefinition
impl<'de> Deserialize<'de> for CommandDefinition
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 CommandDefinition
impl RefUnwindSafe for CommandDefinition
impl Send for CommandDefinition
impl Sync for CommandDefinition
impl Unpin for CommandDefinition
impl UnwindSafe for CommandDefinition
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