pub trait ParseArgFromStr: FromStr{
// Required method
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§
Sourcefn describe_type<W: Write>(writer: W) -> Result
fn describe_type<W: Write>(writer: W) -> Result
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
implemented.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.