pub struct OptionDecl {
pub long: String,
pub short: Option<char>,
pub takes_value: bool,
pub allows_bare: bool,
pub repeatable: bool,
pub choices: Option<Vec<String>>,
}Expand description
Declaration of a single option (long flag, optionally with short alias).
Fields§
§long: StringLong name (without -- prefix).
short: Option<char>Single-character short alias (without - prefix).
takes_value: boolTrue for value-carrying options; false for presence-only flags (bool).
allows_bare: boolTrue if bare --foo is legal (field type is bool, or a default is
declared for an Option<T>). Ignored when takes_value = false.
repeatable: boolTrue for list-typed options (Vec<T>): multiple occurrences and
comma-separated values accumulate.
choices: Option<Vec<String>>Restrict values to this set (validated at parse time).
Trait Implementations§
Source§impl Clone for OptionDecl
impl Clone for OptionDecl
Source§fn clone(&self) -> OptionDecl
fn clone(&self) -> OptionDecl
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 OptionDecl
impl RefUnwindSafe for OptionDecl
impl Send for OptionDecl
impl Sync for OptionDecl
impl Unpin for OptionDecl
impl UnsafeUnpin for OptionDecl
impl UnwindSafe for OptionDecl
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