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§
Sourcefn get_options(&self, command: &str) -> Vec<OptionDef>
fn get_options(&self, command: &str) -> Vec<OptionDef>
Get all options available for a specific command
Sourcefn validate(
&self,
command: &str,
option: &str,
value: Option<&str>,
) -> ValidationResult<()>
fn validate( &self, command: &str, option: &str, value: Option<&str>, ) -> ValidationResult<()>
Validate a specific option and its value
Sourcefn get_commands(&self) -> Vec<String>
fn get_commands(&self) -> Vec<String>
Get commands supported by this provider
Provided Methods§
Sourcefn supports_command(&self, command: &str) -> bool
fn supports_command(&self, command: &str) -> bool
Check if this provider supports a specific command