Card

Trait Card 

Source
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§

Source

fn name(&self) -> &str

Returns the name of the card

Source

fn version(&self) -> &str

Returns the version of the card

Source

fn description(&self) -> &str

Returns a description of the card

Source

fn initialize(&mut self, config: &CardConfig) -> Result<()>

Initializes the card with the given configuration

Source

fn execute(&self, command: &str, args: &[String]) -> Result<()>

Executes a command provided by the card

Source

fn commands(&self) -> Vec<CardCommand>

Returns a list of commands provided by the card

Source

fn cleanup(&mut self) -> Result<()>

Cleans up any resources used by the card

Implementors§