Trait RenderStep

Source
pub trait RenderStep: Debug {
    // Provided methods
    fn initialize(&mut self, meta: &mut MetaData<'_>) { ... }
    fn render_type(&mut self, ctx: &mut Context<'_, '_>) { ... }
    fn finish(&mut self, meta: &MetaData<'_>, module: &mut Module) { ... }
}
Expand description

Trait that is used to define a renderer.

A render step is used to generate the actual code of a specific DataType. The idea is that different render steps generate different code. This can be used by the user to compose different render steps depending on his needs, or he could even implement customized steps on his own.

Provided Methods§

Source

fn initialize(&mut self, meta: &mut MetaData<'_>)

Initialized the renderer.

This is called once for each renderer when the generator is initialized.

Source

fn render_type(&mut self, ctx: &mut Context<'_, '_>)

Renders the code for the given type.

This is called once for each type that needs to be rendered.

Source

fn finish(&mut self, meta: &MetaData<'_>, module: &mut Module)

Finishes the rendering process.

This is called once for each renderer after the actual rendering of the types is finished and the code generation process is being finished.

Implementors§