Trait meap::parser::Parser

source ·
pub trait Parser: Sized {
    type Item;

Show 13 methods // Required methods fn register_low_level( &self, ll: &mut LowLevelParser ) -> Result<(), SpecError>; fn parse_low_level( &mut self, ll: &mut LowLevelParserOutput ) -> Result<Self::Item, Box<dyn Error>>; fn update_help(&self, help: &mut Help); // Provided methods fn parse_args<A: IntoIterator<Item = String>>( self, program_name: String, args: A ) -> Result<Self::Item, (Box<dyn Error>, SpentParser<Self>)> { ... } fn parse_env( self ) -> Result<Self::Item, (Box<dyn Error>, SpentParser<Self>)> { ... } fn both<PU: Parser>(self, other: PU) -> Both<Self::Item, PU::Item, Self, PU> { ... } fn map<U, F: FnOnce(Self::Item) -> U>( self, f: F ) -> Map<Self::Item, U, F, Self> { ... } fn with_help<N: IntoName>(self, name: N) -> WithHelp<Self::Item, Self> { ... } fn with_help_default(self) -> WithHelp<Self::Item, Self> { ... } fn with_default_general<T>(self, value: T) -> WithDefaultGeneral<T, Self> { ... } fn choose_at_most_one<O: Parser>(self, other: O) -> ChooseAtMostOne<Self, O> { ... } fn with_default_lazy_general<T, F: FnOnce() -> T>( self, f: F ) -> WithDefaultLazyGeneral<T, F, Self> { ... } fn required_general<S: AsRef<str>>( self, error_message: S ) -> RequiredGeneral<Self> { ... }
}

Required Associated Types§

Required Methods§

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)

Provided Methods§

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>

Implementors§

source§

impl Parser for Extra

source§

impl<A: Arity, H: HasParam, N: NameType> Parser for Arg<A, H, N>where Self: SingleArgParser + SingleArgParserHelp,

§

type Item = <Arg<A, H, N> as SingleArgParser>::SingleArgItem

source§

impl<T> Parser for SomeIf<T>

§

type Item = Option<T>

source§

impl<T, F: FnOnce() -> T, P: Parser<Item = Option<T>>> Parser for WithDefaultLazyGeneral<T, F, P>

§

type Item = T

source§

impl<T, P: Parser<Item = Option<T>>> Parser for RequiredGeneral<P>

§

type Item = T

source§

impl<T, P: Parser<Item = Option<T>>> Parser for WithDefaultGeneral<T, P>

§

type Item = T

source§

impl<T, PA: Parser<Item = Option<T>>, PB: Parser<Item = Option<T>>> Parser for ChooseAtMostOne<PA, PB>

§

type Item = Option<T>

source§

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

§

type Item = OrHelp<T>

source§

impl<T, U, F: FnOnce(T) -> U, POT: ParserOpt<ItemOpt = T>> Parser for MapOpt<T, U, F, POT>

§

type Item = Option<U>

source§

impl<T, U, F: FnOnce(T) -> U, PT: Parser<Item = T>> Parser for Map<T, U, F, PT>

§

type Item = U

source§

impl<T, U, PT: Parser<Item = T>, PU: Parser<Item = U>> Parser for Both<T, U, PT, PU>

§

type Item = (T, U)

source§

impl<V: FromStr, T: From<V>, D: DefaultValue<Item = T>> Parser for WithDefault<V, T, D>

§

type Item = T