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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".