pub trait FromArgValue: Sized {
// Required method
fn from_arg_value(value: &str) -> Result<Self, String>;
}
Expand description
Types which can be constructed from a single commandline value.
Any field type declared in a struct that derives FromArgs
must implement
this trait. A blanket implementation exists for types implementing
FromStr<Error: Display>
. Custom types can implement this trait
directly.
Required Methods§
Sourcefn from_arg_value(value: &str) -> Result<Self, String>
fn from_arg_value(value: &str) -> Result<Self, String>
Construct the type from a commandline value, returning an error string on failure.
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.