pub trait Card: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn description(&self) -> &str;
fn initialize(&mut self, config: &CardConfig) -> Result<()>;
fn execute(&self, command: &str, args: &[String]) -> Result<()>;
fn commands(&self) -> Vec<CardCommand>;
fn cleanup(&mut self) -> Result<()>;
}Expand description
Trait that all cards must implement
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Returns a description of the card
Sourcefn initialize(&mut self, config: &CardConfig) -> Result<()>
fn initialize(&mut self, config: &CardConfig) -> Result<()>
Initializes the card with the given configuration
Sourcefn execute(&self, command: &str, args: &[String]) -> Result<()>
fn execute(&self, command: &str, args: &[String]) -> Result<()>
Executes a command provided by the card
Sourcefn commands(&self) -> Vec<CardCommand>
fn commands(&self) -> Vec<CardCommand>
Returns a list of commands provided by the card