pub trait ValueParser {
type Error;
type Out<'a>;
// Required method
fn parse(val: Option<&String>) -> Result<Self::Out<'_>, Self::Error>;
}
Expand description
A trait for parsing command line argument values into various types
This trait provides a unified interface for converting string values from command line arguments into different Rust types. Each implementation handles type-specific parsing logic and error reporting.
Required Associated Types§
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 ValueParser for &str
Implementation of ValueParser for string slices
impl ValueParser for &str
Implementation of ValueParser for string slices
Returns a reference to the input string’s contents
Source§impl ValueParser for bool
Implementation of ValueParser for boolean values
impl ValueParser for bool
Implementation of ValueParser for boolean values
Returns true if any value is present, false otherwise
Source§impl ValueParser for f64
impl ValueParser for f64
Source§impl ValueParser for i8
impl ValueParser for i8
Source§impl ValueParser for i16
impl ValueParser for i16
Source§impl ValueParser for i32
impl ValueParser for i32
Source§impl ValueParser for i64
impl ValueParser for i64
Source§impl ValueParser for i128
impl ValueParser for i128
Source§impl ValueParser for isize
impl ValueParser for isize
Source§impl ValueParser for u8
impl ValueParser for u8
Source§impl ValueParser for u16
impl ValueParser for u16
Source§impl ValueParser for u32
impl ValueParser for u32
Source§impl ValueParser for u64
impl ValueParser for u64
Source§impl ValueParser for u128
impl ValueParser for u128
Source§impl ValueParser for usize
impl ValueParser for usize
Source§impl ValueParser for String
Implementation of ValueParser for String values
impl ValueParser for String
Implementation of ValueParser for String values
Returns a cloned String from the input value
Source§impl ValueParser for Path
Implementation of ValueParser for Path references
impl ValueParser for Path
Implementation of ValueParser for Path references
Returns a reference to a Path created from the input string
Source§impl ValueParser for PathBuf
Implementation of ValueParser for PathBuf values
impl ValueParser for PathBuf
Implementation of ValueParser for PathBuf values
Converts the input string into a PathBuf