Trait ligen::Generator[][src]

pub trait Generator: FileGenerator + FFIGenerator {
    fn new(context: &Context, attributes: &Attributes) -> Self;

    fn pre_process(
        &self,
        _context: &Context,
        implementation: Option<&Implementation>
    ) -> Option<Implementation> { ... }
fn generate(
        &self,
        context: &Context,
        implementation: Option<&Implementation>
    ) -> Result<TokenStream, Error> { ... }
fn save_file_set(
        &self,
        context: &Context,
        file_set: FileSet
    ) -> Result<(), Error> { ... } }
Expand description

Generator trait.

Required methods

Creates a new generator using contextual information and attributes.

Provided methods

Pre-processes the input. The default implementation returns a transformed input with all the Self and self occurrences replaced by the actual object name.

Main function called in the procedural macro.

Saves the file set.

Implementors