pub enum ArgValidator {
ExactArgs(usize),
MinimumArgs(usize),
MaximumArgs(usize),
RangeArgs(usize, usize),
OnlyValidArgs(Vec<String>),
Custom(Arc<ValidatorFn>),
}Expand description
Defines validation rules for command arguments
Variants§
ExactArgs(usize)
Exactly N arguments required
MinimumArgs(usize)
At least N arguments required
MaximumArgs(usize)
At most N arguments allowed
RangeArgs(usize, usize)
Between min and max arguments (inclusive)
OnlyValidArgs(Vec<String>)
Arguments must be in the valid args list
Custom(Arc<ValidatorFn>)
Custom validation function
Implementations§
Trait Implementations§
Source§impl Clone for ArgValidator
impl Clone for ArgValidator
Source§fn clone(&self) -> ArgValidator
fn clone(&self) -> ArgValidator
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 moreAuto Trait Implementations§
impl Freeze for ArgValidator
impl !RefUnwindSafe for ArgValidator
impl Send for ArgValidator
impl Sync for ArgValidator
impl Unpin for ArgValidator
impl !UnwindSafe for ArgValidator
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