Trait cargho::FromArgValue [−][src]
pub trait FromArgValue: Sized { 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
fn 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.