pub struct MetaprogrammingEngine { /* private fields */ }Expand description
Metaprogramming engine for dynamic code generation
Implementations§
Source§impl MetaprogrammingEngine
impl MetaprogrammingEngine
Sourcepub fn register_template(&mut self, name: String, template: CodeTemplate)
pub fn register_template(&mut self, name: String, template: CodeTemplate)
Register a code template
Sourcepub fn register_macro(&mut self, name: String, macro_def: MacroDefinition)
pub fn register_macro(&mut self, name: String, macro_def: MacroDefinition)
Register a macro definition
Sourcepub fn generate_from_template(
&self,
template_name: &str,
parameters: &TemplateParameters,
) -> JitResult<GeneratedCode>
pub fn generate_from_template( &self, template_name: &str, parameters: &TemplateParameters, ) -> JitResult<GeneratedCode>
Generate code from a template
Sourcepub fn expand_macro(
&self,
macro_name: &str,
args: &[MacroArgument],
) -> JitResult<GeneratedCode>
pub fn expand_macro( &self, macro_name: &str, args: &[MacroArgument], ) -> JitResult<GeneratedCode>
Expand a macro with given arguments
Sourcepub fn reflect_graph(&self, graph: &ComputationGraph) -> GraphReflection
pub fn reflect_graph(&self, graph: &ComputationGraph) -> GraphReflection
Reflect on a computation graph
Sourcepub fn generate_specialized_code(
&self,
base_template: &str,
specialization_info: &SpecializationInfo,
) -> JitResult<GeneratedCode>
pub fn generate_specialized_code( &self, base_template: &str, specialization_info: &SpecializationInfo, ) -> JitResult<GeneratedCode>
Generate specialized code based on runtime information
Auto Trait Implementations§
impl Freeze for MetaprogrammingEngine
impl RefUnwindSafe for MetaprogrammingEngine
impl Send for MetaprogrammingEngine
impl Sync for MetaprogrammingEngine
impl Unpin for MetaprogrammingEngine
impl UnsafeUnpin for MetaprogrammingEngine
impl UnwindSafe for MetaprogrammingEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more