pub struct LuaGenerator { /* private fields */ }Implementations§
Source§impl LuaGenerator
impl LuaGenerator
pub fn generate_expression(&self, expression: &Expression) -> String
Source§impl LuaGenerator
impl LuaGenerator
pub const INDENT: &'static str = "\t"
pub const MODULE_META_START: &'static str = "-- Generated by factorio-rs@0.1.2"
pub fn new() -> Self
pub fn with_mod_name(mod_name: impl Into<String>) -> Self
pub fn with_debug_level(debug_level: u8) -> Self
pub fn with_mod_name_and_debug( mod_name: impl Into<String>, debug_level: u8, ) -> Self
Sourcepub fn with_module_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_module_prefix(self, prefix: impl Into<String>) -> Self
Set the module prefix applied to all generated module filenames and local names.
Sourcepub fn with_profile(self, profile: impl Into<String>) -> Self
pub fn with_profile(self, profile: impl Into<String>) -> Self
Record the transpile profile name in generated file headers.
pub fn apply_path_prefix(&self, path: &str) -> String
Sourcepub fn prefixed_local(&self, local: &str) -> String
pub fn prefixed_local(&self, local: &str) -> String
Return the prefixed local variable name for a module import.
Sourcepub fn generate_module(&mut self, module: &Module) -> LuaGeneratorResult<String>
pub fn generate_module(&mut self, module: &Module) -> LuaGeneratorResult<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LuaGenerator
impl RefUnwindSafe for LuaGenerator
impl Send for LuaGenerator
impl Sync for LuaGenerator
impl Unpin for LuaGenerator
impl UnsafeUnpin for LuaGenerator
impl UnwindSafe for LuaGenerator
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