Skip to main content

Pass

Trait Pass 

Source
pub trait Pass: Transformer {
    type Argument: Parse;

    // Required method
    fn through(
        &mut self,
        input: TokenStream,
        argument: Self::Argument,
    ) -> Result<TokenStream>;
}
Expand description

A trait that represents a singular pass over an input token stream.

This is a stronger-typed alternative to the Transformer trait, which is obligated to be dyn-safe.

§Blanket Implementation

A blanket implementation for Transformer for all implementors of Pass is automatically performed.

It is advisable to use generic bounds of this type in respect to Transformer.

Required Associated Types§

Source

type Argument: Parse

The argument type used by this pass.

If no argument is required, it is advisable to use the Nothing type.

Required Methods§

Source

fn through( &mut self, input: TokenStream, argument: Self::Argument, ) -> Result<TokenStream>

Pass-through an input [token stream] with an appropiate source-parsable argument.

Implementors§