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§
Required Methods§
Sourcefn compile(
&self,
code: &mut impl Read,
config: Self::Config,
) -> CompilationResult<CompiledCode<R>>
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§
Source§impl Compiler<NativeRuntime> for CppCompiler
impl Compiler<NativeRuntime> for CppCompiler
type Config = CppCompilerConfig
Source§impl Compiler<NativeRuntime> for PythonCompiler
Compiler for native runtime.
impl Compiler<NativeRuntime> for PythonCompiler
Compiler for native runtime.
Source§impl Compiler<NativeRuntime> for RustCompiler
impl Compiler<NativeRuntime> for RustCompiler
type Config = RustCompilerConfig
Source§impl Compiler<WasmRuntime> for CppCompiler
impl Compiler<WasmRuntime> for CppCompiler
type Config = CppCompilerConfig
Source§impl Compiler<WasmRuntime> for PythonCompiler
impl Compiler<WasmRuntime> for PythonCompiler
Source§impl Compiler<WasmRuntime> for RustCompiler
impl Compiler<WasmRuntime> for RustCompiler
type Config = RustCompilerConfig
Source§impl<C> Compiler<JailedRuntime> for Cwhere
C: Compiler<NativeRuntime>,
Implementation of JailedRuntime compiler for every native compiler.
impl<C> Compiler<JailedRuntime> for Cwhere
C: Compiler<NativeRuntime>,
Implementation of JailedRuntime compiler for every native compiler.