Lines Matching defs:ValueParser

11 /// `ValueParser` defines how to convert a raw argument value into a validated and typed value for
16 /// - [`ValueParser::new`] for additional [`TypedValueParser`] that can be used
59 pub struct ValueParser(ValueParserInner);
73 impl ValueParser {
98 /// .value_parser(clap::builder::ValueParser::new(parse_env_var))
171 /// # use clap::{Command, Arg, builder::ValueParser};
178 /// .value_parser(ValueParser::os_string())
221 impl ValueParser {
260 /// Convert a [`TypedValueParser`] to [`ValueParser`]
282 impl<P> From<P> for ValueParser
291 impl From<_AnonymousValueParser> for ValueParser {
297 /// Create an `i64` [`ValueParser`] from a `N..M` range
320 impl From<std::ops::Range<i64>> for ValueParser {
327 /// Create an `i64` [`ValueParser`] from a `N..=M` range
350 impl From<std::ops::RangeInclusive<i64>> for ValueParser {
357 /// Create an `i64` [`ValueParser`] from a `N..` range
380 impl From<std::ops::RangeFrom<i64>> for ValueParser {
387 /// Create an `i64` [`ValueParser`] from a `..M` range
410 impl From<std::ops::RangeTo<i64>> for ValueParser {
417 /// Create an `i64` [`ValueParser`] from a `..=M` range
440 impl From<std::ops::RangeToInclusive<i64>> for ValueParser {
447 /// Create an `i64` [`ValueParser`] from a `..` range
470 impl From<std::ops::RangeFull> for ValueParser {
477 /// Create a [`ValueParser`] with [`PossibleValuesParser`]
501 impl<P, const C: usize> From<[P; C]> for ValueParser
511 /// Create a [`ValueParser`] with [`PossibleValuesParser`]
536 impl<P> From<Vec<P>> for ValueParser
546 impl std::fmt::Debug for ValueParser {
549 ValueParserInner::Bool => f.debug_struct("ValueParser::bool").finish(),
550 ValueParserInner::String => f.debug_struct("ValueParser::string").finish(),
551 ValueParserInner::OsString => f.debug_struct("ValueParser::os_string").finish(),
552 ValueParserInner::PathBuf => f.debug_struct("ValueParser::path_buf").finish(),
553 ValueParserInner::Other(o) => write!(f, "ValueParser::other({:?})", o.type_id()),
558 impl Clone for ValueParser {
846 /// Implementation for [`ValueParser::string`]
854 /// Implementation for [`ValueParser::string`]
894 /// Implementation for [`ValueParser::os_string`]
902 /// Implementation for [`ValueParser::os_string`]
936 /// Implementation for [`ValueParser::path_buf`]
944 /// Implementation for [`ValueParser::path_buf`]
1609 /// Implementation for [`ValueParser::bool`]
1617 /// Implementation for [`ValueParser::bool`]
1676 /// - [`ValueParser::bool`] for assuming non-false is true
1769 /// - [`ValueParser::bool`] for different human readable bool representations
1868 /// - [`ValueParser::string`]
2091 /// Generated parser, usually [`ValueParser`].
2093 /// It should at least be a type that supports `Into<ValueParser>`. A non-`ValueParser` type
2101 type Parser = ValueParser;
2103 ValueParser::string() // Default `clap_derive` to optimized implementation
2107 type Parser = ValueParser;
2109 ValueParser::os_string() // Default `clap_derive` to optimized implementation
2113 type Parser = ValueParser;
2115 ValueParser::path_buf() // Default `clap_derive` to optimized implementation
2119 type Parser = ValueParser;
2121 ValueParser::bool() // Default `clap_derive` to optimized implementation
2197 /// Unstable [`ValueParser`]
2202 pub struct _AnonymousValueParser(ValueParser);
2309 _AnonymousValueParser(ValueParser::new(func))
2314 /// Select a [`ValueParser`] implementation from the intended type
2318 /// - [Native types][ValueParser]: `bool`, `String`, `OsString`, `PathBuf`
2349 /// assert_eq!(format!("{:?}", parser), "ValueParser::string");
2351 /// assert_eq!(format!("{:?}", parser), "ValueParser::os_string");
2353 /// assert_eq!(format!("{:?}", parser), "ValueParser::path_buf");
2359 /// assert_eq!(format!("{:?}", parser), "_AnonymousValueParser(ValueParser::other(usize))");
2378 impl<P: Into<ValueParser>> _ValueParserViaSelfSealed for &&&&&&&_AutoValueParser<P> {}