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§
Sourcefn initialize(&mut self, meta: &mut MetaData<'_>)
fn initialize(&mut self, meta: &mut MetaData<'_>)
Initialized the renderer.
This is called once for each renderer when the generator is initialized.
Sourcefn render_type(&mut self, ctx: &mut Context<'_, '_>)
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.