pub trait Validator: Send + Sync {
// Required methods
fn validate(&self, input: &str) -> ValidationResult;
fn partial_validate(
&self,
input: &str,
cursor_pos: usize,
) -> PartialValidationResult;
fn priority(&self) -> Priority;
fn name(&self) -> &str;
// Provided method
fn description(&self) -> &str { ... }
}Expand description
Core trait for all validators
Required Methods§
Sourcefn validate(&self, input: &str) -> ValidationResult
fn validate(&self, input: &str) -> ValidationResult
Validate complete input
Sourcefn partial_validate(
&self,
input: &str,
cursor_pos: usize,
) -> PartialValidationResult
fn partial_validate( &self, input: &str, cursor_pos: usize, ) -> PartialValidationResult
Validate partial input during typing
Provided Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get human-readable description of this validator