Trait argp::FromArgValue
source · pub trait FromArgValue: Sized {
// Required method
fn from_arg_value(value: &OsStr) -> Result<Self, String>;
}Expand description
Types which can be constructed from a single command-line value.
Any field type declared in a struct that derives FromArgs must implement
this trait. Argp implements it for:
- all built-in number types
boolcharStringstd::ffi::OsStringstd::path::PathBufstd::net::IpAddrand its variantsstd::net::SocketAddrand its variants
Custom types should implement this trait directly.
Required Methods§
sourcefn from_arg_value(value: &OsStr) -> Result<Self, String>
fn from_arg_value(value: &OsStr) -> Result<Self, String>
Construct the type from a command-line value, returning an error string on failure.