pub struct Compiler<'a> {
pub deps: Vec<&'a CompiledModule>,
}
Expand description
An API for the compiler. Supports setting custom options.
Fields§
§deps: Vec<&'a CompiledModule>
Extra dependencies to compile with.
Implementations§
source§impl<'a> Compiler<'a>
impl<'a> Compiler<'a>
pub fn new(deps: Vec<&'a CompiledModule>) -> Self
sourcepub fn into_compiled_script_and_source_map(
self,
file_name: Symbol,
code: &str
) -> Result<(CompiledScript, SourceMap)>
pub fn into_compiled_script_and_source_map( self, file_name: Symbol, code: &str ) -> Result<(CompiledScript, SourceMap)>
Compiles into a CompiledScript
where the bytecode hasn’t been serialized.
sourcepub fn into_script_blob(self, file_name: &str, code: &str) -> Result<Vec<u8>>
pub fn into_script_blob(self, file_name: &str, code: &str) -> Result<Vec<u8>>
Compiles the script into a serialized form.
sourcepub fn into_compiled_module(
self,
file_name: &str,
code: &str
) -> Result<CompiledModule>
pub fn into_compiled_module( self, file_name: &str, code: &str ) -> Result<CompiledModule>
Compiles the module.