Trait teleparse::Produce

source ·
pub trait Produce: Sized + ToSpan {
    type Prod: Production;

    // Required method
    fn produce(
        parser: &mut Parser<'_, <Self::Prod as Production>::L>,
        meta: &Metadata<<Self::Prod as Production>::L>,
    ) -> Result<Self, <Self::Prod as Production>::L>;

    // Provided method
    fn prod_id() -> TypeId { ... }
}

Required Associated Types§

Required Methods§

source

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> Result<Self, <Self::Prod as Production>::L>

Provided Methods§

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<L: Lexicon, A: Produce, B: Produce> Produce for (A, B)
where <A as Produce>::Prod: Production<L = L>, <B as Produce>::Prod: Production<L = L>,

§

type Prod = (<A as Produce>::Prod, <B as Produce>::Prod)

source§

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> Result<Self, <Self::Prod as Production>::L>

source§

impl<L: Lexicon, A: Produce, B: Produce, C: Produce> Produce for (A, B, C)
where <A as Produce>::Prod: Production<L = L>, <B as Produce>::Prod: Production<L = L>, <C as Produce>::Prod: Production<L = L>,

§

type Prod = (<A as Produce>::Prod, <B as Produce>::Prod, <C as Produce>::Prod)

source§

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> Result<Self, <Self::Prod as Production>::L>

source§

impl<L: Lexicon, A: Produce, B: Produce, C: Produce, D: Produce> Produce for (A, B, C, D)
where <A as Produce>::Prod: Production<L = L>, <B as Produce>::Prod: Production<L = L>, <C as Produce>::Prod: Production<L = L>, <D as Produce>::Prod: Production<L = L>,

§

type Prod = (<A as Produce>::Prod, <B as Produce>::Prod, <C as Produce>::Prod, <D as Produce>::Prod)

source§

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> Result<Self, <Self::Prod as Production>::L>

source§

impl<L: Lexicon, A: Produce, B: Produce, C: Produce, D: Produce, E: Produce> Produce for (A, B, C, D, E)
where <A as Produce>::Prod: Production<L = L>, <B as Produce>::Prod: Production<L = L>, <C as Produce>::Prod: Production<L = L>, <D as Produce>::Prod: Production<L = L>, <E as Produce>::Prod: Production<L = L>,

§

type Prod = (<A as Produce>::Prod, <B as Produce>::Prod, <C as Produce>::Prod, <D as Produce>::Prod, <E as Produce>::Prod)

source§

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> Result<Self, <Self::Prod as Production>::L>

source§

impl<T: Produce> Produce for Box<T>

§

type Prod = Box<<T as Produce>::Prod>

source§

fn produce( parser: &mut Parser<'_, <Self::Prod as Production>::L>, meta: &Metadata<<Self::Prod as Production>::L>, ) -> SynResult<Self, <Self::Prod as Production>::L>

Implementors§

source§

impl<S, T: Produce> Produce for Quote<S, T>
where S: for<'a> From<&'a str>,

§

type Prod = <T as Produce>::Prod

source§

impl<S: FromStr, T: Produce> Produce for Parse<S, T>

§

type Prod = <T as Produce>::Prod

source§

impl<T: Produce> Produce for Exists<T>

§

type Prod = OptionProd<<T as Produce>::Prod>

source§

impl<T: Produce> Produce for Loop<T>

§

type Prod = OneOrMore<<T as Produce>::Prod>

source§

impl<T: Produce> Produce for Optional<T>

§

type Prod = OptionProd<<T as Produce>::Prod>

source§

impl<T: Produce, P: Produce> Produce for Punct<T, P>
where P::Prod: Production<L = <T::Prod as Production>::L>,

§

type Prod = PunctProd<<T as Produce>::Prod, <P as Produce>::Prod>

source§

impl<T: Produce, P: Produce> Produce for Split<T, P>
where P::Prod: Production<L = <T::Prod as Production>::L>,

§

type Prod = (<T as Produce>::Prod, OptionProd<OneOrMore<(<P as Produce>::Prod, <T as Produce>::Prod)>>)

source§

impl<T: Produce, R: Produce> Produce for Recover<T, R>
where R::Prod: Production<L = <T::Prod as Production>::L>,

§

type Prod = (<T as Produce>::Prod, <R as Produce>::Prod)

source§

impl<V: FromIterator<T> + Default, T: Produce> Produce for Star<V, T>

§

type Prod = OptionProd<OneOrMore<<T as Produce>::Prod>>

source§

impl<V: FromIterator<T>, T: Produce> Produce for Plus<V, T>

§

type Prod = OneOrMore<<T as Produce>::Prod>