pub enum ArgType {
String,
Enum(Vec<String>),
Integer {
min: Option<i128>,
max: Option<i128>,
},
Float {
min: Option<f64>,
max: Option<f64>,
},
FileSize {
min: Option<u64>,
max: Option<u64>,
},
}Variants§
String
Any string
Enum(Vec<String>)
The argument must be one of the variants.
Integer
I recommend you use Self::integer(), Self::uinteger()
or Self::integer_between().
Float
I recommend you use Self::float() or Self::float_between().
FileSize
I recommend you use Self::file_size() or Self::file_size_between().
It’s in bytes.
Implementations§
Source§impl ArgType
impl ArgType
pub fn integer() -> Self
pub fn uinteger() -> Self
pub fn float() -> Self
pub fn enum_(variants: &[&str]) -> Self
pub fn file_size() -> Self
pub fn file_size_between(min: Option<u64>, max: Option<u64>) -> Self
pub fn parse(&self, arg: &str, span: Span) -> Result<String, RawError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArgType
impl RefUnwindSafe for ArgType
impl Send for ArgType
impl Sync for ArgType
impl Unpin for ArgType
impl UnwindSafe for ArgType
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