pub trait ParseArgFromStr: FromStrwhere
    <Self as FromStr>::Err: Display,
{ fn describe_type<W: Write>(writer: W) -> Result; }
Expand description

Shorthand for implementing ParseArg for types that already implement FromStr.

This trait allows to implement ParseArg cheaply, just by providing the description. Prefer this approach if your type already impls FromStr without copying the string. In case the implementation can be made more performant by directly implementing ParseArg, prefer direct implementation. (This is what String does for example.)

This trait should only be implemented - do not use it as a bound! Use ParseArg as a bound because it is more general and provides same features.

Required Methods§

Writes human-readable description of the type to the writer.

For full information, read the documentation for ParseArgs::describe_type.

ParseArgs::describe_type is delegated to this method when ParseArgFromStr is implmented.

Implementations on Foreign Types§

Implementors§