Produce

Trait 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§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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>,

Source§

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>,

Source§

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>,

Source§

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>,

Source§

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>

Source§

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>,

Source§

type Prod = <T as Produce>::Prod

Source§

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

Source§

type Prod = <T as Produce>::Prod

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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>,

Source§

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>,

Source§

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>,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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