Trait parse_arg::Arg

source ·
pub trait Arg: Sized + AsRef<OsStr> {
    fn parse<T: ParseArg>(self) -> Result<T, <T as ParseArg>::Error>;
}
Expand description

A type that can be parsed.

Usually &OsStr or OsString. It’s used to automatically pick the right method if ParseArg trait.

Required Methods§

Parses the argument from self using appropriate method.

In case self is OsString or can be converted to it at no cost ParseArg::parse_owned_arg() is used. Otherwise ParseArg::parse_arg() is used.

Implementations on Foreign Types§

Using this with std::env::args() is not a good practice, but it may be useful for testing.

Using this with std::env::args() is not a good practice, but it may be useful for testing.

Implementors§