OptionProperties

Struct OptionProperties 

Source
pub struct OptionProperties<'a, O: Default, P: Default> {
    pub matcher: &'a Matcher<O, P>,
    pub char_index: usize,
    pub env_line_approximate_char_index: usize,
    pub arg_index: usize,
    pub env_arg_index: usize,
    pub option_index: usize,
    pub code: String,
    pub value_text: Option<String>,
}
Expand description

Properties for an Option Arg variant

Fields§

§matcher: &'a Matcher<O, P>

Matcher which matched this argument.

§char_index: usize

Index of character where the parsed argument started. If a line was parsed, this will be the index in the line. If environmental arguments were parsed, this will be the index in the environmental argument where the parsed argument started.

§env_line_approximate_char_index: usize

Approximate index of character in the line where the parsed argument started. If a line was parsed, this will be the same as char_index and be exact. If environmental arguments were parsed, this will an approximate position in the line.

§arg_index: usize

Index of the parsed argument.

§env_arg_index: usize

Index of the environment argument in which the parsed argument started. If a line is parsed, this will always be zero.

§option_index: usize

Index of the parsed option arguments. (Parameters arguments are ignored in this index.)

§code: String

Option code of the option argument.

§value_text: Option<String>

Text in the option value. If option did not have a value, then this holds None.

Trait Implementations§

Source§

impl<'a, O: Default, P: Default> ArgProperties<O, P> for OptionProperties<'a, O, P>

Source§

fn matcher(&self) -> &Matcher<O, P>

Matcher which matched this argument.
Source§

fn char_index(&self) -> usize

Index of character where the parsed argument started. If a line was parsed, this will be the index in the line. If environmental arguments were parsed, this will be the index in the environmental argument where the parsed argument started.
Source§

fn env_line_approximate_char_index(&self) -> usize

Approximate index of character in the line where the parsed argument started. If a line was parsed, this will be the same as char_index and be exact. If environmental arguments were parsed, this will an approximate position in the line.
Source§

fn arg_index(&self) -> usize

Index of the parsed argument.
Source§

fn env_arg_index(&self) -> usize

Index of the environment argument in which the parsed argument started. If a line is parsed, this will always be zero.
Source§

impl<'a, O: Debug + Default, P: Debug + Default> Debug for OptionProperties<'a, O, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, O, P> Freeze for OptionProperties<'a, O, P>

§

impl<'a, O, P> RefUnwindSafe for OptionProperties<'a, O, P>

§

impl<'a, O, P> Send for OptionProperties<'a, O, P>
where O: Sync, P: Sync,

§

impl<'a, O, P> Sync for OptionProperties<'a, O, P>
where O: Sync, P: Sync,

§

impl<'a, O, P> Unpin for OptionProperties<'a, O, P>

§

impl<'a, O, P> UnwindSafe for OptionProperties<'a, O, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.