pub enum ParsedValue {
Scalar(String),
Repeated(Vec<OptionOccurrence>),
}Expand description
The value parsed for a single positional argument or option
CliParser::parse_typed returns HashMap<String, ParsedValue> so
that repeatable options (which may occur zero or more times, each
with their own sub-parameters) and plain scalar values can coexist in
a single result map. CliParser::parse remains additive and
unaffected — see its docs for how the two relate.
Variants§
Scalar(String)
A plain positional argument or non-repeatable option value.
Repeated(Vec<OptionOccurrence>)
Every occurrence of a repeatable option, in command-line order.
Trait Implementations§
Source§impl Clone for ParsedValue
impl Clone for ParsedValue
Source§fn clone(&self) -> ParsedValue
fn clone(&self) -> ParsedValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ParsedValue
impl Debug for ParsedValue
Source§impl PartialEq for ParsedValue
impl PartialEq for ParsedValue
impl StructuralPartialEq for ParsedValue
Auto Trait Implementations§
impl Freeze for ParsedValue
impl RefUnwindSafe for ParsedValue
impl Send for ParsedValue
impl Sync for ParsedValue
impl Unpin for ParsedValue
impl UnsafeUnpin for ParsedValue
impl UnwindSafe for ParsedValue
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