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
  • bool
  • char
  • String
  • std::ffi::OsString
  • std::path::PathBuf
  • std::net::IpAddr and its variants
  • std::net::SocketAddr and its variants

Custom types should implement this trait directly.

Required Methods§

source

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

Construct the type from a command-line value, returning an error string on failure.

Implementations on Foreign Types§

source§

impl FromArgValue for i32

source§

impl FromArgValue for SocketAddrV4

source§

impl FromArgValue for i16

source§

impl FromArgValue for u16

source§

impl FromArgValue for Ipv6Addr

source§

impl FromArgValue for u32

source§

impl FromArgValue for f64

source§

impl FromArgValue for SocketAddr

source§

impl FromArgValue for i128

source§

impl FromArgValue for char

source§

impl FromArgValue for PathBuf

source§

impl FromArgValue for u8

source§

impl FromArgValue for u128

source§

impl FromArgValue for Ipv4Addr

source§

impl FromArgValue for IpAddr

source§

impl FromArgValue for OsString

source§

impl FromArgValue for bool

source§

impl FromArgValue for String

source§

impl FromArgValue for u64

source§

impl FromArgValue for isize

source§

impl FromArgValue for i64

source§

impl FromArgValue for SocketAddrV6

source§

impl FromArgValue for f32

source§

impl FromArgValue for i8

source§

impl FromArgValue for usize

Implementors§