[−][src]Struct gong::options::OptionSet
Option set
Used to supply the set of information about available options to match against
This is the non-“extendible” variant. Unlike its cousin OptionSetEx
, this holds options lists
as slice references rather than Vec
s, and thus cannot be extended in size (hence no add_*
methods). This is particularly useful in efficient creation of static/const option sets.
Fields
long: &'r [LongOption<'a>]
short: &'r [ShortOption]
mode: OptionsMode
allow_abbreviations: bool
Implementations
impl<'r, 'a: 'r> OptionSet<'r, 'a>
[src]
pub fn to_extendible(&self) -> OptionSetEx<'a>
[src]
Creates an “extendible” copy of self
This duplicates the options in self
into an OptionSetEx
.
pub fn set_mode(&mut self, mode: OptionsMode) -> &mut Self
[src]
Set mode
pub fn set_allow_abbreviations(&mut self, allow: bool) -> &mut Self
[src]
Enable/disable abbreviated matching
pub fn is_empty(&self) -> bool
[src]
Checks if empty
pub fn is_valid(&self) -> bool
[src]
pub fn validate(&'r self) -> Result<(), Vec<OptionFlaw<'a>>>
[src]
Checks validity of option set, returning details of any problems
pub fn process<T>(&self, args: &'a [T]) -> Analysis<'a> where
T: AsRef<str>,
[src]
T: AsRef<str>,
Analyses provided program arguments.
Returns a result set describing the result of the analysis. This may include &str
references to strings provided in the args
parameter and in self
. Take note of this with
respect to object lifetimes.
Expects self
to be valid (see is_valid
).
Trait Implementations
impl<'r, 'a: 'r> Clone for OptionSet<'r, 'a>
[src]
impl<'r, 'a: 'r> Debug for OptionSet<'r, 'a>
[src]
impl<'r, 'a: 'r> Default for OptionSet<'r, 'a>
[src]
impl<'r, 'a: 'r> Eq for OptionSet<'r, 'a>
[src]
impl<'r, 'a: 'r> PartialEq<OptionSet<'r, 'a>> for OptionSet<'r, 'a>
[src]
pub fn eq(&self, other: &OptionSet<'r, 'a>) -> bool
[src]
pub fn ne(&self, other: &OptionSet<'r, 'a>) -> bool
[src]
impl<'r, 'a: 'r> PartialEq<OptionSet<'r, 'a>> for OptionSetEx<'a>
[src]
pub fn eq(&self, rhs: &OptionSet<'r, 'a>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'r, 'a: 'r> PartialEq<OptionSetEx<'a>> for OptionSet<'r, 'a>
[src]
pub fn eq(&self, rhs: &OptionSetEx<'a>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'r, 'a: 'r> StructuralEq for OptionSet<'r, 'a>
[src]
impl<'r, 'a: 'r> StructuralPartialEq for OptionSet<'r, 'a>
[src]
Auto Trait Implementations
impl<'r, 'a> RefUnwindSafe for OptionSet<'r, 'a>
[src]
impl<'r, 'a> Send for OptionSet<'r, 'a>
[src]
impl<'r, 'a> Sync for OptionSet<'r, 'a>
[src]
impl<'r, 'a> Unpin for OptionSet<'r, 'a> where
'a: 'r,
[src]
'a: 'r,
impl<'r, 'a> UnwindSafe for OptionSet<'r, 'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,