pub struct RustCodeGenerator { /* private fields */ }Expand description
Rust code generator for mathematical expressions
Implementations§
Source§impl RustCodeGenerator
impl RustCodeGenerator
Sourcepub fn with_config(config: RustCodegenConfig) -> Self
pub fn with_config(config: RustCodegenConfig) -> Self
Create a new Rust code generator with custom configuration
Sourcepub fn with_settings(debug_info: bool, unsafe_optimizations: bool) -> Self
👎Deprecated since 0.1.0: Use with_config instead
pub fn with_settings(debug_info: bool, unsafe_optimizations: bool) -> Self
Create a new Rust code generator with custom settings (deprecated, use with_config)
Sourcepub fn config(&self) -> &RustCodegenConfig
pub fn config(&self) -> &RustCodegenConfig
Get the current configuration
Sourcepub fn set_config(&mut self, config: RustCodegenConfig)
pub fn set_config(&mut self, config: RustCodegenConfig)
Update the configuration
Sourcepub fn generate_function_with_registry<T: NumericType + Float + Copy>(
&self,
expr: &ASTRepr<T>,
function_name: &str,
type_name: &str,
registry: &VariableRegistry,
) -> Result<String>
pub fn generate_function_with_registry<T: NumericType + Float + Copy>( &self, expr: &ASTRepr<T>, function_name: &str, type_name: &str, registry: &VariableRegistry, ) -> Result<String>
Generate Rust source code for a mathematical expression with variable registry (generic version)
Sourcepub fn generate_function_generic<T: NumericType + Float + Copy>(
&self,
expr: &ASTRepr<T>,
function_name: &str,
type_name: &str,
) -> Result<String>
pub fn generate_function_generic<T: NumericType + Float + Copy>( &self, expr: &ASTRepr<T>, function_name: &str, type_name: &str, ) -> Result<String>
Generate Rust source code for a mathematical expression (generic version)
Sourcepub fn generate_function(
&self,
expr: &ASTRepr<f64>,
function_name: &str,
) -> Result<String>
pub fn generate_function( &self, expr: &ASTRepr<f64>, function_name: &str, ) -> Result<String>
Generate Rust source code for a mathematical expression (f64 specialization for backwards compatibility)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustCodeGenerator
impl RefUnwindSafe for RustCodeGenerator
impl Send for RustCodeGenerator
impl Sync for RustCodeGenerator
impl Unpin for RustCodeGenerator
impl UnwindSafe for RustCodeGenerator
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