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.
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.