]> git.proxmox.com Git - rustc.git/blame - src/vendor/clap/src/args/any_arg.rs
New upstream version 1.18.0+dfsg1
[rustc.git] / src / vendor / clap / src / args / any_arg.rs
CommitLineData
8bb4bdeb
XL
1// Std
2use std::rc::Rc;
3use std::fmt as std_fmt;
4use std::ffi::{OsStr, OsString};
5
6// Third Party
7use vec_map::{self, VecMap};
8
9// Internal
10use args::settings::ArgSettings;
8bb4bdeb
XL
11
12#[doc(hidden)]
13pub 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
41pub trait DispOrder {
42 fn disp_ord(&self) -> usize;
43}