Lines Matching defs:std

1 use std::convert::TryInto;
2 use std::ops::RangeBounds;
87 /// fn parse_env_var(env: &str) -> Result<EnvVar, std::io::Error> {
165 /// [`OsString`][std::ffi::OsString] parser for argument values
172 /// use std::ffi::OsString;
173 /// use std::os::unix::ffi::{OsStrExt,OsStringExt};
195 /// [`PathBuf`][std::path::PathBuf] parser for argument values
200 /// # use std::path::PathBuf;
201 /// # use std::path::Path;
229 value: &std::ffi::OsStr,
320 impl From<std::ops::Range<i64>> for ValueParser {
321 fn from(value: std::ops::Range<i64>) -> Self {
350 impl From<std::ops::RangeInclusive<i64>> for ValueParser {
351 fn from(value: std::ops::RangeInclusive<i64>) -> Self {
380 impl From<std::ops::RangeFrom<i64>> for ValueParser {
381 fn from(value: std::ops::RangeFrom<i64>) -> Self {
410 impl From<std::ops::RangeTo<i64>> for ValueParser {
411 fn from(value: std::ops::RangeTo<i64>) -> Self {
440 impl From<std::ops::RangeToInclusive<i64>> for ValueParser {
441 fn from(value: std::ops::RangeToInclusive<i64>) -> Self {
470 impl From<std::ops::RangeFull> for ValueParser {
471 fn from(value: std::ops::RangeFull) -> Self {
546 impl std::fmt::Debug for ValueParser {
547 fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
576 value: &std::ffi::OsStr,
583 value: std::ffi::OsString,
598 T: std::any::Any + Clone + Send + Sync + 'static,
605 value: &std::ffi::OsStr,
615 value: std::ffi::OsString,
665 /// value: &std::ffi::OsStr,
696 value: &std::ffi::OsStr,
706 value: std::ffi::OsString,
770 /// # use std::ffi::OsString;
771 /// # use std::ffi::OsStr;
772 /// # use std::path::PathBuf;
773 /// # use std::path::Path;
810 E: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
819 E: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
828 value: &std::ffi::OsStr,
867 value: &std::ffi::OsStr,
876 value: std::ffi::OsString,
909 type Value = std::ffi::OsString;
915 value: &std::ffi::OsStr,
924 value: std::ffi::OsString,
951 type Value = std::path::PathBuf;
957 value: &std::ffi::OsStr,
966 value: std::ffi::OsString,
994 /// # use std::ffi::OsStr;
1025 std::marker::PhantomData<E>,
1031 let phantom: std::marker::PhantomData<E> = Default::default();
1043 value: &std::ffi::OsStr,
1127 /// # use std::ffi::OsStr;
1155 value: &std::ffi::OsStr,
1164 value: std::ffi::OsString,
1238 /// # use std::ffi::OsStr;
1252 pub struct RangedI64ValueParser<T: std::convert::TryFrom<i64> + Clone + Send + Sync = i64> {
1253 bounds: (std::ops::Bound<i64>, std::ops::Bound<i64>),
1254 target: std::marker::PhantomData<T>,
1257 impl<T: std::convert::TryFrom<i64> + Clone + Send + Sync> RangedI64ValueParser<T> {
1269 l @ std::ops::Bound::Included(i) => {
1278 l @ std::ops::Bound::Excluded(i) => {
1287 std::ops::Bound::Unbounded => self.bounds.start_bound().cloned(),
1290 l @ std::ops::Bound::Included(i) => {
1299 l @ std::ops::Bound::Excluded(i) => {
1308 std::ops::Bound::Unbounded => self.bounds.end_bound().cloned(),
1316 std::ops::Bound::Included(i) => i.to_string(),
1317 std::ops::Bound::Excluded(i) => i.saturating_add(1).to_string(),
1318 std::ops::Bound::Unbounded => i64::MIN.to_string(),
1322 std::ops::Bound::Included(i) => {
1326 std::ops::Bound::Excluded(i) => {
1329 std::ops::Bound::Unbounded => {
1337 impl<T: std::convert::TryFrom<i64> + Clone + Send + Sync + 'static> TypedValueParser
1340 <T as std::convert::TryFrom<i64>>::Error: Send + Sync + 'static + std::error::Error + ToString,
1348 raw_value: &std::ffi::OsStr,
1396 impl<T: std::convert::TryFrom<i64> + Clone + Send + Sync, B: RangeBounds<i64>> From<B>
1407 impl<T: std::convert::TryFrom<i64> + Clone + Send + Sync> Default for RangedI64ValueParser<T> {
1436 /// # use std::ffi::OsStr;
1450 pub struct RangedU64ValueParser<T: std::convert::TryFrom<u64> = u64> {
1451 bounds: (std::ops::Bound<u64>, std::ops::Bound<u64>),
1452 target: std::marker::PhantomData<T>,
1455 impl<T: std::convert::TryFrom<u64>> RangedU64ValueParser<T> {
1467 l @ std::ops::Bound::Included(i) => {
1476 l @ std::ops::Bound::Excluded(i) => {
1485 std::ops::Bound::Unbounded => self.bounds.start_bound().cloned(),
1488 l @ std::ops::Bound::Included(i) => {
1497 l @ std::ops::Bound::Excluded(i) => {
1506 std::ops::Bound::Unbounded => self.bounds.end_bound().cloned(),
1514 std::ops::Bound::Included(i) => i.to_string(),
1515 std::ops::Bound::Excluded(i) => i.saturating_add(1).to_string(),
1516 std::ops::Bound::Unbounded => u64::MIN.to_string(),
1520 std::ops::Bound::Included(i) => {
1524 std::ops::Bound::Excluded(i) => {
1527 std::ops::Bound::Unbounded => {
1535 impl<T: std::convert::TryFrom<u64> + Clone + Send + Sync + 'static> TypedValueParser
1538 <T as std::convert::TryFrom<u64>>::Error: Send + Sync + 'static + std::error::Error + ToString,
1546 raw_value: &std::ffi::OsStr,
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> {
1637 value: &std::ffi::OsStr,
1639 let value = if value == std::ffi::OsStr::new("true") {
1641 } else if value == std::ffi::OsStr::new("false") {
1698 /// # use std::ffi::OsStr;
1737 value: &std::ffi::OsStr,
1791 /// # use std::ffi::OsStr;
1834 value: &std::ffi::OsStr,
1889 /// # use std::ffi::OsStr;
1915 value: &std::ffi::OsStr,
1975 value: &std::ffi::OsStr,
1986 value: std::ffi::OsString,
2015 E: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
2028 E: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
2036 value: &std::ffi::OsStr,
2080 /// value: &std::ffi::OsStr,
2106 impl ValueParserFactory for std::ffi::OsString {
2112 impl ValueParserFactory for std::path::PathBuf {
2187 pub struct _AutoValueParser<T>(std::marker::PhantomData<T>);
2242 FromOsString: From<std::ffi::OsString> + std::any::Any + Clone + Send + Sync + 'static,
2260 for<'s> From<&'s std::ffi::OsStr> + std::any::Any + Clone + Send + Sync + 'static,
2277 FromString: From<String> + std::any::Any + Clone + Send + Sync + 'static,
2290 FromStr: for<'s> From<&'s str> + std::any::Any + Clone + Send + Sync + 'static,
2303 Parse: std::str::FromStr + std::any::Any + Clone + Send + Sync + 'static,
2304 <Parse as std::str::FromStr>::Err: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
2307 let func: fn(&str) -> Result<Parse, <Parse as std::str::FromStr>::Err> =
2321 /// - [`From<OsString>` types][std::convert::From] and [`From<&OsStr>` types][std::convert::From]
2322 /// - [`From<String>` types][std::convert::From] and [`From<&str>` types][std::convert::From]
2323 /// - [`FromStr` types][std::str::FromStr], including usize, isize
2329 /// # use std::path::PathBuf;
2330 /// # use std::path::Path;
2350 /// let parser = clap::value_parser!(std::ffi::OsString);
2352 /// let parser = clap::value_parser!(std::path::PathBuf);
2388 FromOsString: From<std::ffi::OsString> + std::any::Any + Send + Sync + 'static
2394 FromOsStr: for<'s> From<&'s std::ffi::OsStr> + std::any::Any + Send + Sync + 'static
2400 FromString: From<String> + std::any::Any + Send + Sync + 'static
2406 FromStr: for<'s> From<&'s str> + std::any::Any + Send + Sync + 'static
2413 Parse: std::str::FromStr + std::any::Any + Send + Sync + 'static,
2414 <Parse as std::str::FromStr>::Err: Into<Box<dyn std::error::Error + Send + Sync + 'static>>,
2425 fn parse(_: &str) -> Result<usize, std::io::Error> {
2431 TypedValueParser::parse_ref(&parse, &cmd, arg, std::ffi::OsStr::new("foo")).unwrap(),