[][src]Trait parse_arg::ParseArgFromStr

pub trait ParseArgFromStr: FromStr where
    Self::Err: Display
{ fn describe_type<W: Write>(writer: W) -> Result; }

Shorthand for implementing ParseArg for types that already implement FromStr.

This trait allows to implement ParseArg cheaply, just by providing the description. Prefer this approach if your type already impls FromStr without copying the string. In case the implementation can be made more performant by directly implementing ParseArg, prefer direct implementation. (This is what String does for example.)

This trait should only be implemented - do not use it as a bound! Use ParseArg as a bound because it is more general and provides same features.

Required methods

fn describe_type<W: Write>(writer: W) -> Result

Writes human-readable description of the type to the writer.

For full information, read the documentation for ParseArgs::describe_type.

ParseArgs::describe_type is delegated to this method when ParseArgFromStr is implmented.

Loading content...

Implementations on Foreign Types

impl ParseArgFromStr for u8[src]

impl ParseArgFromStr for u16[src]

impl ParseArgFromStr for u32[src]

impl ParseArgFromStr for u64[src]

impl ParseArgFromStr for u128[src]

impl ParseArgFromStr for usize[src]

impl ParseArgFromStr for i8[src]

impl ParseArgFromStr for i16[src]

impl ParseArgFromStr for i32[src]

impl ParseArgFromStr for i64[src]

impl ParseArgFromStr for i128[src]

impl ParseArgFromStr for isize[src]

impl ParseArgFromStr for f32[src]

impl ParseArgFromStr for f64[src]

impl ParseArgFromStr for IpAddr[src]

impl ParseArgFromStr for Ipv4Addr[src]

impl ParseArgFromStr for Ipv6Addr[src]

impl ParseArgFromStr for SocketAddr[src]

impl ParseArgFromStr for SocketAddrV4[src]

impl ParseArgFromStr for SocketAddrV6[src]

impl ParseArgFromStr for bool[src]

Loading content...

Implementors

Loading content...