pub trait Arg: Sized + AsRef<OsStr> {
// Required method
fn parse<T: ParseArg>(self) -> Result<T, <T as ParseArg>::Error>;
}Expand description
A type that can be parsed.
Usually &OsStr or OsString. It’s used to automatically pick the right
method of ParseArg trait.
Required Methods§
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.
Implementations on Foreign Types§
Source§impl Arg for String
Using this with std::env::args() is not a good practice, but it may be
useful for testing.
impl Arg for String
Using this with std::env::args() is not a good practice, but it may be
useful for testing.
Source§impl<'a> Arg for &'a str
Using this with std::env::args() is not a good practice, but it may be
useful for testing.
impl<'a> Arg for &'a str
Using this with std::env::args() is not a good practice, but it may be
useful for testing.