pub struct ElixirBackend { /* private fields */ }Expand description
Elixir code generation backend.
Implementations§
Source§impl ElixirBackend
impl ElixirBackend
Sourcepub fn with_indent(indent: &str) -> Self
pub fn with_indent(indent: &str) -> Self
Create a backend that uses a custom indentation string.
Sourcepub fn mangle_name(&self, name: &str) -> String
pub fn mangle_name(&self, name: &str) -> String
Mangle an OxiLean identifier into a valid Elixir atom/function name.
- CamelCase becomes
snake_case - Reserved Elixir words get a trailing
_
Sourcepub fn mangle_module_name(&self, name: &str) -> String
pub fn mangle_module_name(&self, name: &str) -> String
Mangle an OxiLean module/type name into a valid Elixir module atom.
Elixir modules are CamelCase atoms.
Sourcepub fn emit_expr(&self, expr: &ElixirExpr) -> String
pub fn emit_expr(&self, expr: &ElixirExpr) -> String
Emit an ElixirExpr as Elixir source text.
Sourcepub fn emit_function(&self, func: &ElixirFunction) -> String
pub fn emit_function(&self, func: &ElixirFunction) -> String
Emit an ElixirFunction as Elixir source text.
Sourcepub fn emit_module(&self, module: &ElixirModule) -> String
pub fn emit_module(&self, module: &ElixirModule) -> String
Emit an ElixirModule as a complete Elixir source file.
Sourcepub fn emit_runtime(&self) -> &'static str
pub fn emit_runtime(&self) -> &'static str
Return the Elixir source of the OxiLean runtime module.
Trait Implementations§
Source§impl Default for ElixirBackend
impl Default for ElixirBackend
Auto Trait Implementations§
impl Freeze for ElixirBackend
impl RefUnwindSafe for ElixirBackend
impl Send for ElixirBackend
impl Sync for ElixirBackend
impl Unpin for ElixirBackend
impl UnsafeUnpin for ElixirBackend
impl UnwindSafe for ElixirBackend
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