Struct gong::Options
[−]
[src]
pub struct Options<'a> { pub long: Vec<LongOption<'a>>, pub short: Vec<ShortOption>, pub mode: OptionsMode, pub allow_abbreviations: bool, }
Used to supply the set of information about available options to match against
Fields
long: Vec<LongOption<'a>>
short: Vec<ShortOption>
mode: OptionsMode
allow_abbreviations: bool
Methods
impl<'a> Options<'a>
[src]
fn new(count_long: usize, count_short: usize) -> Self
[src]
Create a new object. Takes estimations of the number of options to expect to be added (for efficient vector allocation).
fn set_mode(&mut self, mode: OptionsMode) -> &mut Self
[src]
Set mode
fn set_allow_abbreviations(&mut self, allow: bool) -> &mut Self
[src]
Enable/disable abbreviated matching
fn add_long(&mut self, name: &'a str) -> &mut Self
[src]
Add a long option
Panics (debug only) on invalid name.
fn add_short(&mut self, ch: char) -> &mut Self
[src]
Add a short option
Panics (debug only) on invalid char
choice.
fn add_long_data(&mut self, name: &'a str) -> &mut Self
[src]
Add a long option that expects data
Panics (debug only) on invalid name.
fn add_short_data(&mut self, ch: char) -> &mut Self
[src]
Add a short option that expects data
Panics (debug only) on invalid char
choice.
fn is_valid(&self) -> bool
[src]
Checks validity of option set
Returns true
if valid. Outputs details of problems found to stderr
.
Trait Implementations
impl<'a> Debug for Options<'a>
[src]
impl<'a> Clone for Options<'a>
[src]
fn clone(&self) -> Options<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> PartialEq for Options<'a>
[src]
fn eq(&self, __arg_0: &Options<'a>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Options<'a>) -> bool
[src]
This method tests for !=
.