Trait CompilerContext

Source
pub trait CompilerContext: Context + Sized {
    type CompileError: Debug;

    // Required method
    fn compile(
        main_mod: Symbol,
        modules: HashMap<Symbol, ExportedModule<Self>>,
    ) -> Result<Vec<u8>, Self::CompileError>;
}
Expand description

A Context that allows for the compilation of OftLisp code.

Required Associated Types§

Source

type CompileError: Debug

An error encountered during compilation.

Required Methods§

Source

fn compile( main_mod: Symbol, modules: HashMap<Symbol, ExportedModule<Self>>, ) -> Result<Vec<u8>, Self::CompileError>

Compiles a module.

This function gets passed the name of the main module, as well as the module and its dependencies.

It should return the contents of the object file.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§