Trait OptionProvider

Source
pub trait OptionProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn get_options(&self, command: &str) -> Vec<OptionDef>;
    fn validate(
        &self,
        command: &str,
        option: &str,
        value: Option<&str>,
    ) -> ValidationResult<()>;
    fn get_commands(&self) -> Vec<String>;

    // Provided method
    fn supports_command(&self, command: &str) -> bool { ... }
}
Expand description

Trait for providing option definitions and validation for a specific tool or framework

Required Methods§

Source

fn name(&self) -> &str

Get the name of this provider (e.g., “cargo”, “leptos”, “dioxus”)

Source

fn get_options(&self, command: &str) -> Vec<OptionDef>

Get all options available for a specific command

Source

fn validate( &self, command: &str, option: &str, value: Option<&str>, ) -> ValidationResult<()>

Validate a specific option and its value

Source

fn get_commands(&self) -> Vec<String>

Get commands supported by this provider

Provided Methods§

Source

fn supports_command(&self, command: &str) -> bool

Check if this provider supports a specific command

Implementors§