pub struct ValidationEngine { /* private fields */ }
Expand description
Main validation engine
Implementations§
Source§impl ValidationEngine
impl ValidationEngine
Sourcepub fn with_config(config: ValidationConfig) -> Self
pub fn with_config(config: ValidationConfig) -> Self
Create with custom configuration
Sourcepub fn validate_option(
&self,
command: &str,
option: &str,
value: Option<&str>,
) -> ValidationResult<()>
pub fn validate_option( &self, command: &str, option: &str, value: Option<&str>, ) -> ValidationResult<()>
Validate a single option for a given command
Sourcepub fn validate_options(
&self,
command: &str,
options: &HashMap<String, Option<String>>,
) -> ValidationResult<()>
pub fn validate_options( &self, command: &str, options: &HashMap<String, Option<String>>, ) -> ValidationResult<()>
Validate multiple options for a command
Sourcepub fn suggest_option(&self, command: &str, option: &str) -> Vec<String>
pub fn suggest_option(&self, command: &str, option: &str) -> Vec<String>
Get suggestions for a misspelled option
Sourcepub fn get_options(&self, command: &str) -> Vec<OptionDef>
pub fn get_options(&self, command: &str) -> Vec<OptionDef>
Get all valid options for a command
Sourcepub fn register_provider(&mut self, provider: Box<dyn OptionProvider>)
pub fn register_provider(&mut self, provider: Box<dyn OptionProvider>)
Register a new provider
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ValidationEngine
impl !RefUnwindSafe for ValidationEngine
impl Send for ValidationEngine
impl Sync for ValidationEngine
impl Unpin for ValidationEngine
impl !UnwindSafe for ValidationEngine
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