pub trait Bake {
// Required method
fn bake(&self, ctx: &CrateEnv) -> TokenStream;
}
Expand description
The Bake
trait allows a piece of data to write itself into a Rust expression.
This can be used to generate files with hardcoded data.
Required Methods§
sourcefn bake(&self, ctx: &CrateEnv) -> TokenStream
fn bake(&self, ctx: &CrateEnv) -> TokenStream
Returns a TokenStream
that would evaluate to self
.
Crates that are required for the evaluation of the TokenStream
will be
added to ctx
.