Struct meap::parser::WithHelp

source ·
pub struct WithHelp<T, PT: Parser<Item = T>> { /* private fields */ }

Implementations§

source§

impl<T, PT: Parser<Item = T>> WithHelp<T, PT>

source

pub fn new<N: IntoName>(parser_t: PT, name: N) -> Self

source

pub fn new_default(parser_t: PT) -> Self

source

pub fn desc<S: AsRef<str>>(self, description: S) -> Self

source

pub fn name<N: IntoName>(self, name: N) -> Self

source

pub fn with_program_description<S: AsRef<str>>( self, program_description: S ) -> Self

source

pub fn parse_env_or_exit(self) -> T

source

pub fn with_version<S: AsRef<str>>(self, version: S) -> Self

source

pub fn version_name<N: IntoName>(self, name: N) -> Self

source

pub fn with_version_help_description<S: AsRef<str>>( self, version_help_description: S ) -> Self

source

pub fn with_version_default<S: AsRef<str>>(self, version: S) -> Self

source

pub fn with_version_description<S: AsRef<str>>( self, version_description: S ) -> Self

Trait Implementations§

source§

impl<T, PT: Parser<Item = T>> Parser for WithHelp<T, PT>

§

type Item = OrHelp<T>

source§

fn register_low_level(&self, ll: &mut LowLevelParser) -> Result<(), SpecError>

source§

fn parse_low_level( &mut self, ll: &mut LowLevelParserOutput ) -> Result<Self::Item, Box<dyn Error>>

source§

fn update_help(&self, help: &mut Help)

source§

fn parse_args<A: IntoIterator<Item = String>>( self, program_name: String, args: A ) -> Result<Self::Item, (Box<dyn Error>, SpentParser<Self>)>

source§

fn parse_env(self) -> Result<Self::Item, (Box<dyn Error>, SpentParser<Self>)>

source§

fn both<PU: Parser>(self, other: PU) -> Both<Self::Item, PU::Item, Self, PU>

source§

fn map<U, F: FnOnce(Self::Item) -> U>(self, f: F) -> Map<Self::Item, U, F, Self>

source§

fn with_help<N: IntoName>(self, name: N) -> WithHelp<Self::Item, Self>

source§

fn with_help_default(self) -> WithHelp<Self::Item, Self>

source§

fn with_default_general<T>(self, value: T) -> WithDefaultGeneral<T, Self>

source§

fn choose_at_most_one<O: Parser>(self, other: O) -> ChooseAtMostOne<Self, O>

source§

fn with_default_lazy_general<T, F: FnOnce() -> T>( self, f: F ) -> WithDefaultLazyGeneral<T, F, Self>

source§

fn required_general<S: AsRef<str>>( self, error_message: S ) -> RequiredGeneral<Self>

Auto Trait Implementations§

§

impl<T, PT> RefUnwindSafe for WithHelp<T, PT>where PT: RefUnwindSafe,

§

impl<T, PT> Send for WithHelp<T, PT>where PT: Send,

§

impl<T, PT> Sync for WithHelp<T, PT>where PT: Sync,

§

impl<T, PT> Unpin for WithHelp<T, PT>where PT: Unpin,

§

impl<T, PT> UnwindSafe for WithHelp<T, PT>where PT: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.