Trait argh::FromArgValue

source ·
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§


fn from_arg_value(value: &str) -> Result<Self, String>

Construct the type from a commandline value, returning an error string on failure.

Object Safety§

This trait is not object safe.



impl<T> FromArgValue for Twhere T: FromStr, T::Err: Display,