Trait clap::builder::TypedValueParser
source · [−]pub trait TypedValueParser: Clone + Send + Sync + 'static {
type Value;
fn parse_ref(
&self,
cmd: &Command<'_>,
arg: Option<&Arg<'_>>,
value: &OsStr
) -> Result<Self::Value, Error>;
fn parse(
&self,
cmd: &Command<'_>,
arg: Option<&Arg<'_>>,
value: OsString
) -> Result<Self::Value, Error> { ... }
fn possible_values(
&self
) -> Option<Box<dyn Iterator<Item = PossibleValue<'static>>>> { ... }
}
Expand description
Parse/validate argument values
Associated Types
Required methods
Provided methods
Parse the argument value
When arg
is None
, an external subcommand value is being parsed.
fn possible_values(
&self
) -> Option<Box<dyn Iterator<Item = PossibleValue<'static>>>>
fn possible_values(
&self
) -> Option<Box<dyn Iterator<Item = PossibleValue<'static>>>>
Reflect on enumerated value properties
Error checking should not be done with this; it is mostly targeted at user-facing applications like errors and completion.