logo
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

Argument’s value type

Required methods

Parse the argument value

When arg is None, an external subcommand value is being parsed.

Provided methods

Parse the argument value

When arg is None, an external subcommand value is being parsed.

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.

Implementors