Trait Compiler

Source
pub trait Compiler<R: CodeRuntime>:
    Send
    + Sync
    + Sized {
    type Config: Send + Sync + Sized + Debug + Clone + Default + IntoArgs;

    // Required method
    fn compile(
        &self,
        code: &mut impl Read,
        config: Self::Config,
    ) -> CompilationResult<CompiledCode<R>>;
}
Expand description

Trait for every compiler that can be used to compile some code.

Required Associated Types§

Source

type Config: Send + Sync + Sized + Debug + Clone + Default + IntoArgs

Configuration for the compiler.

Required Methods§

Source

fn compile( &self, code: &mut impl Read, config: Self::Config, ) -> CompilationResult<CompiledCode<R>>

Compile the given code (as stream of bytes) and return the executable (in temporary 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§