pub enum CliFormat {
Any,
Integer,
Decimal,
Boolean,
Email,
Url,
StringRange(Range<usize>),
IntegerRange(Range<i64>),
DecimalRange(Range<f64>),
OneOf(Vec<String>),
File,
Directory,
}Expand description
Format validators for command arguments and flags.
These validators can be used to ensure arguments and flags conform to expected formats before processing.
Variants§
Any
Accept any string value.
Integer
Must be a valid integer.
Decimal
Must be a valid decimal number.
Boolean
Must be a boolean value (true/false, yes/no, 1/0).
Must be a valid email address.
Url
Must be a valid URL.
StringRange(Range<usize>)
String length must be within the specified range.
IntegerRange(Range<i64>)
Integer value must be within the specified range.
DecimalRange(Range<f64>)
Decimal value must be within the specified range.
OneOf(Vec<String>)
Value must be one of the specified options.
File
Must be a path to an existing file.
Directory
Must be a path to an existing directory.
Trait Implementations§
impl StructuralPartialEq for CliFormat
Auto Trait Implementations§
impl Freeze for CliFormat
impl RefUnwindSafe for CliFormat
impl Send for CliFormat
impl Sync for CliFormat
impl Unpin for CliFormat
impl UnwindSafe for CliFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more