pub struct Compiler { /* private fields */ }Implementations§
Source§impl Compiler
impl Compiler
pub fn new() -> Self
Sourcepub const fn set_optimization_level(self, level: u8) -> Self
pub const fn set_optimization_level(self, level: u8) -> Self
Sets Luau compiler optimization level.
Possible values:
- 0 - no optimization
- 1 - baseline optimization level that doesn’t prevent debuggability (default)
- 2 - includes optimizations that harm debuggability such as inlining
Sourcepub const fn set_debug_level(self, level: u8) -> Self
pub const fn set_debug_level(self, level: u8) -> Self
Sets Luau compiler debug level.
Possible values:
- 0 - no debugging support
- 1 - line info & function names only; sufficient for backtraces (default)
- 2 - full debug info with local & upvalue names; necessary for debugger
Sourcepub const fn set_type_info_level(self, level: u8) -> Self
pub const fn set_type_info_level(self, level: u8) -> Self
Sets Luau type information level used to guide native code generation decisions.
Possible values:
- 0 - generate for native modules (default)
- 1 - generate for all modules
Sourcepub const fn set_coverage_level(self, level: u8) -> Self
pub const fn set_coverage_level(self, level: u8) -> Self
Sets Luau compiler code coverage level.
Possible values:
- 0 - no code coverage support (default)
- 1 - statement coverage
- 2 - statement and expression coverage (verbose)
pub fn set_vector_lib(self, lib: impl Into<String>) -> Self
pub fn set_vector_ctor(self, ctor: impl Into<String>) -> Self
pub fn set_vector_type(self, type: impl Into<String>) -> Self
Sourcepub fn set_mutable_globals(self, globals: Vec<String>) -> Self
pub fn set_mutable_globals(self, globals: Vec<String>) -> Self
Sets a list of globals that are mutable.
It disables the import optimization for fields accessed through these.
Sourcepub fn set_userdata_types(self, types: Vec<String>) -> Self
pub fn set_userdata_types(self, types: Vec<String>) -> Self
Sets a list of userdata types that will be included in the type information.
Sourcepub fn set_disabled_builtins(self, libs: Vec<String>) -> Self
pub fn set_disabled_builtins(self, libs: Vec<String>) -> Self
Sets a list of disabled builtin libs or functions like tonumber or math.abs
pub fn set_libraries(&mut self, libraries: CompilerLibraries) -> &mut Self
pub fn compile(&self, source: impl AsRef<[u8]>) -> CompilerResult
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Compiler
impl RefUnwindSafe for Compiler
impl Send for Compiler
impl Sync for Compiler
impl Unpin for Compiler
impl UnsafeUnpin for Compiler
impl UnwindSafe for Compiler
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