]>
Commit | Line | Data |
---|---|---|
8bb4bdeb XL |
1 | // Std |
2 | use std::rc::Rc; | |
3 | use std::fmt as std_fmt; | |
4 | use std::ffi::{OsStr, OsString}; | |
5 | ||
6 | // Third Party | |
7 | use vec_map::{self, VecMap}; | |
8 | ||
9 | // Internal | |
10 | use args::settings::ArgSettings; | |
8bb4bdeb XL |
11 | |
12 | #[doc(hidden)] | |
13 | pub trait AnyArg<'n, 'e>: std_fmt::Display { | |
14 | fn name(&self) -> &'n str; | |
8bb4bdeb XL |
15 | fn overrides(&self) -> Option<&[&'e str]>; |
16 | fn aliases(&self) -> Option<Vec<&'e str>>; | |
17 | fn requires(&self) -> Option<&[(Option<&'e str>, &'n str)]>; | |
18 | fn blacklist(&self) -> Option<&[&'e str]>; | |
19 | fn required_unless(&self) -> Option<&[&'e str]>; | |
20 | fn is_set(&self, ArgSettings) -> bool; | |
21 | fn set(&mut self, ArgSettings); | |
22 | fn has_switch(&self) -> bool; | |
23 | fn max_vals(&self) -> Option<u64>; | |
24 | fn min_vals(&self) -> Option<u64>; | |
25 | fn num_vals(&self) -> Option<u64>; | |
26 | fn possible_vals(&self) -> Option<&[&'e str]>; | |
27 | fn validator(&self) -> Option<&Rc<Fn(String) -> Result<(), String>>>; | |
28 | fn validator_os(&self) -> Option<&Rc<Fn(&OsStr) -> Result<(), OsString>>>; | |
29 | fn short(&self) -> Option<char>; | |
30 | fn long(&self) -> Option<&'e str>; | |
31 | fn val_delim(&self) -> Option<char>; | |
32 | fn takes_value(&self) -> bool; | |
33 | fn val_names(&self) -> Option<&VecMap<&'e str>>; | |
34 | fn help(&self) -> Option<&'e str>; | |
cc61c64b XL |
35 | fn default_val(&self) -> Option<&'e OsStr>; |
36 | fn default_vals_ifs(&self) -> Option<vec_map::Values<(&'n str, Option<&'e OsStr>, &'e OsStr)>>; | |
8bb4bdeb | 37 | fn longest_filter(&self) -> bool; |
8bb4bdeb XL |
38 | fn val_terminator(&self) -> Option<&'e str>; |
39 | } | |
40 | ||
41 | pub trait DispOrder { | |
42 | fn disp_ord(&self) -> usize; | |
43 | } |