symforce.codegen.backends.rust.rust_config module¶
- class RustConfig(doc_comment_line_prefix='///', line_length=100, use_eigen_types=False, render_template_config=<factory>, cse_optimizations=None, zero_epsilon_behavior=<factory>, normalize_results=True, scalar_type=ScalarType.DOUBLE)[source]¶
Bases:
CodegenConfig
Code generation config for the Rust backend.
- Parameters:
doc_comment_line_prefix (str) – Prefix applied to each line in a docstring
line_length (int) – Maximum allowed line length in docstrings; used for formatting docstrings.
scala_type – The scalar type to use (float or double)
use_eigen_types (bool) – Use eigen_lcm types for vectors instead of lists
render_template_config (RenderTemplateConfig) – Configuration for template rendering, see RenderTemplateConfig for more information
cse_optimizations (Literal['basic'] | ~typing.Sequence[~typing.Tuple[~typing.Callable, ~typing.Callable]] | None) – Optimizations argument to pass to
sf.cse
zero_epsilon_behavior (ZeroEpsilonBehavior) – What should codegen do if a default epsilon is not set?
normalize_results (bool) – Should function outputs be explicitly projected onto the manifold before returning?
scalar_type (ScalarType) –
- scalar_type: ScalarType = FloatType(String('float64'), nbits=Integer(64), nmant=Integer(52), nexp=Integer(11))¶
- classmethod backend_name()[source]¶
String name for the backend. This should match the directory name in codegen/backends and will be used to namespace by backend in generated code.
- Return type:
- static templates_to_render(generated_file_name)[source]¶
Given a single symbolic function’s filename, provide one or more Jinja templates to render and the relative output paths where they should go.