pub struct ChoiceValidator { /* private fields */ }Expand description
Choice validator for selecting from predefined options
Implementations§
Source§impl ChoiceValidator
impl ChoiceValidator
pub fn new(choices: Vec<String>) -> Self
pub fn case_sensitive(self, case_sensitive: bool) -> Self
pub fn min_choices(self, min: usize) -> Self
pub fn max_choices(self, max: usize) -> Self
pub fn with_priority(self, priority: Priority) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Trait Implementations§
Source§impl Debug for ChoiceValidator
impl Debug for ChoiceValidator
Source§impl Validator for ChoiceValidator
impl Validator for ChoiceValidator
Source§fn validate(&self, input: &str) -> ValidationResult
fn validate(&self, input: &str) -> ValidationResult
Validate complete input
Source§fn partial_validate(
&self,
input: &str,
_cursor_pos: usize,
) -> PartialValidationResult
fn partial_validate( &self, input: &str, _cursor_pos: usize, ) -> PartialValidationResult
Validate partial input during typing
Source§fn description(&self) -> &str
fn description(&self) -> &str
Get human-readable description of this validator
Auto Trait Implementations§
impl Freeze for ChoiceValidator
impl RefUnwindSafe for ChoiceValidator
impl Send for ChoiceValidator
impl Sync for ChoiceValidator
impl Unpin for ChoiceValidator
impl UnwindSafe for ChoiceValidator
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