Lines Matching defs:for
11 /// `ValueParser` defines how to convert a raw argument value into a validated and typed value for
15 /// - [`value_parser!`][crate::value_parser] for automatically selecting an implementation for a given type
16 /// - [`ValueParser::new`] for additional [`TypedValueParser`] that can be used
62 // Common enough to optimize and for possible values
74 /// Custom parser for argument values
78 /// - [`EnumValueParser`] and [`PossibleValuesParser`] for static enumerated values
79 /// - [`BoolishValueParser`] and [`FalseyValueParser`] for alternative `bool` implementations
114 /// [`bool`] parser for argument values
117 /// - [`BoolishValueParser`] for different human readable bool representations
118 /// - [`FalseyValueParser`] for assuming non-false is true
141 /// [`String`] parser for argument values
165 /// [`OsString`][std::ffi::OsString] parser for argument values
195 /// [`PathBuf`][std::path::PathBuf] parser for argument values
282 impl<P> From<P> for ValueParser
291 impl From<_AnonymousValueParser> for ValueParser {
299 /// See [`RangedI64ValueParser`] for more control over the output type.
320 impl From<std::ops::Range<i64>> for ValueParser {
329 /// See [`RangedI64ValueParser`] for more control over the output type.
350 impl From<std::ops::RangeInclusive<i64>> for ValueParser {
359 /// See [`RangedI64ValueParser`] for more control over the output type.
380 impl From<std::ops::RangeFrom<i64>> for ValueParser {
389 /// See [`RangedI64ValueParser`] for more control over the output type.
410 impl From<std::ops::RangeTo<i64>> for ValueParser {
419 /// See [`RangedI64ValueParser`] for more control over the output type.
440 impl From<std::ops::RangeToInclusive<i64>> for ValueParser {
449 /// See [`RangedI64ValueParser`] for more control over the output type.
470 impl From<std::ops::RangeFull> for ValueParser {
479 /// See [`PossibleValuesParser`] for more flexibility in creating the
501 impl<P, const C: usize> From<[P; C]> for ValueParser
513 /// See [`PossibleValuesParser`] for more flexibility in creating the
536 impl<P> From<Vec<P>> for ValueParser
546 impl std::fmt::Debug for ValueParser {
558 impl Clone for ValueParser {
570 /// A type-erased wrapper for [`TypedValueParser`].
596 impl<T, P> AnyValueParser for P
658 /// impl clap::builder::TypedValueParser for CustomValueParser {
816 impl<F, T, E> TypedValueParser for F
846 /// Implementation for [`ValueParser::string`]
848 /// Useful for composing new [`TypedValueParser`]s
854 /// Implementation for [`ValueParser::string`]
860 impl TypedValueParser for StringValueParser {
888 impl Default for StringValueParser {
894 /// Implementation for [`ValueParser::os_string`]
896 /// Useful for composing new [`TypedValueParser`]s
902 /// Implementation for [`ValueParser::os_string`]
908 impl TypedValueParser for OsStringValueParser {
930 impl Default for OsStringValueParser {
936 /// Implementation for [`ValueParser::path_buf`]
938 /// Useful for composing new [`TypedValueParser`]s
944 /// Implementation for [`ValueParser::path_buf`]
950 impl TypedValueParser for PathBufValueParser {
980 impl Default for PathBufValueParser {
1036 impl<E: crate::ValueEnum + Clone + Send + Sync + 'static> TypedValueParser for EnumValueParser<E> {
1095 impl<E: crate::ValueEnum + Clone + Send + Sync + 'static> Default for EnumValueParser<E> {
1104 /// - [`EnumValueParser`] for directly supporting [`ValueEnum`][crate::ValueEnum] types
1105 /// - [`TypedValueParser::map`] for adapting values to a more specialized type, like an external
1148 impl TypedValueParser for PossibleValuesParser {
1201 impl<I, T> From<I> for PossibleValuesParser
1338 for RangedI64ValueParser<T>
1397 for RangedI64ValueParser<T>
1407 impl<T: std::convert::TryFrom<i64> + Clone + Send + Sync> Default for RangedI64ValueParser<T> {
1536 for RangedU64ValueParser<T>
1594 impl<T: std::convert::TryFrom<u64>, B: RangeBounds<u64>> From<B> for RangedU64ValueParser<T> {
1603 impl<T: std::convert::TryFrom<u64>> Default for RangedU64ValueParser<T> {
1609 /// Implementation for [`ValueParser::bool`]
1611 /// Useful for composing new [`TypedValueParser`]s
1617 /// Implementation for [`ValueParser::bool`]
1630 impl TypedValueParser for BoolValueParser {
1667 impl Default for BoolValueParser {
1676 /// - [`ValueParser::bool`] for assuming non-false is true
1677 /// - [`BoolishValueParser`] for different human readable bool representations
1730 impl TypedValueParser for FalseyValueParser {
1760 impl Default for FalseyValueParser {
1769 /// - [`ValueParser::bool`] for different human readable bool representations
1770 /// - [`FalseyValueParser`] for assuming non-false is true
1827 impl TypedValueParser for BoolishValueParser {
1859 impl Default for BoolishValueParser {
1908 impl TypedValueParser for NonEmptyStringValueParser {
1935 impl Default for NonEmptyStringValueParser {
1962 impl<P, F, T> TypedValueParser for MapValueParser<P, F>
2022 impl<P, F, T, E> TypedValueParser for TryMapValueParser<P, F>
2064 /// impl clap::builder::ValueParserFactory for Custom {
2073 /// impl clap::builder::TypedValueParser for CustomValueParser {
2100 impl ValueParserFactory for String {
2106 impl ValueParserFactory for std::ffi::OsString {
2112 impl ValueParserFactory for std::path::PathBuf {
2118 impl ValueParserFactory for bool {
2124 impl ValueParserFactory for u8 {
2132 impl ValueParserFactory for i8 {
2140 impl ValueParserFactory for u16 {
2148 impl ValueParserFactory for i16 {
2156 impl ValueParserFactory for u32 {
2164 impl ValueParserFactory for i32 {
2172 impl ValueParserFactory for i64 {
2178 impl ValueParserFactory for u64 {
2213 impl<P: ValueParserFactory> _ValueParserViaFactory for &&&&&&_AutoValueParser<P> {
2227 for &&&&&_AutoValueParser<E>
2240 impl<FromOsString> _ValueParserViaFromOsString for &&&&_AutoValueParser<FromOsString>
2257 impl<FromOsStr> _ValueParserViaFromOsStr for &&&_AutoValueParser<FromOsStr>
2260 for<'s> From<&'s std::ffi::OsStr> + std::any::Any + Clone + Send + Sync + 'static,
2275 impl<FromString> _ValueParserViaFromString for &&_AutoValueParser<FromString>
2288 impl<FromStr> _ValueParserViaFromStr for &_AutoValueParser<FromStr>
2290 FromStr: for<'s> From<&'s str> + std::any::Any + Clone + Send + Sync + 'static,
2301 impl<Parse> _ValueParserViaParse for _AutoValueParser<Parse>
2378 impl<P: Into<ValueParser>> _ValueParserViaSelfSealed for &&&&&&&_AutoValueParser<P> {}
2381 impl<P: ValueParserFactory> _ValueParserViaFactorySealed for &&&&&&_AutoValueParser<P> {}
2384 impl<E: crate::ValueEnum> _ValueParserViaValueEnumSealed for &&&&&_AutoValueParser<E> {}
2387 impl<FromOsString> _ValueParserViaFromOsStringSealed for &&&&_AutoValueParser<FromOsString> where
2393 impl<FromOsStr> _ValueParserViaFromOsStrSealed for &&&_AutoValueParser<FromOsStr> where
2394 FromOsStr: for<'s> From<&'s std::ffi::OsStr> + std::any::Any + Send + Sync + 'static
2399 impl<FromString> _ValueParserViaFromStringSealed for &&_AutoValueParser<FromString> where
2405 impl<FromStr> _ValueParserViaFromStrSealed for &_AutoValueParser<FromStr> where
2406 FromStr: for<'s> From<&'s str> + std::any::Any + Send + Sync + 'static
2411 impl<Parse> _ValueParserViaParseSealed for _AutoValueParser<Parse>