pub enum ValueValidator {
Any,
Number,
Enum(Vec<String>),
Regex(String),
FilePath,
DirectoryPath,
Custom(String),
}
Expand description
Validator for option values
Variants§
Any
Any string value
Number
Must be a valid number
Enum(Vec<String>)
Must be one of the specified values
Regex(String)
Must match the regex pattern
FilePath
Must be a valid file path
DirectoryPath
Must be a valid directory path
Custom(String)
Custom validation function name (for extensibility)
Implementations§
Source§impl ValueValidator
impl ValueValidator
Sourcepub fn validate(&self, value: &str) -> ValidationResult<()>
pub fn validate(&self, value: &str) -> ValidationResult<()>
Validate a value against this validator
Trait Implementations§
Source§impl Clone for ValueValidator
impl Clone for ValueValidator
Source§fn clone(&self) -> ValueValidator
fn clone(&self) -> ValueValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ValueValidator
impl Debug for ValueValidator
Source§impl<'de> Deserialize<'de> for ValueValidator
impl<'de> Deserialize<'de> for ValueValidator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ValueValidator
impl RefUnwindSafe for ValueValidator
impl Send for ValueValidator
impl Sync for ValueValidator
impl Unpin for ValueValidator
impl UnwindSafe for ValueValidator
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