pub struct StreamingCompiler<MCG, FCG, RM, E, CGEN>where
MCG: ModuleCodeGenerator<FCG, RM, E>,
FCG: FunctionCodeGenerator<E>,
RM: RunnableModule + 'static,
E: Debug,
CGEN: Fn() -> MiddlewareChain,{ /* private fields */ }Expand description
A streaming compiler which is designed to generated code for a module based on a stream of wasm parser events.
Implementations§
Source§impl<MCG, FCG, RM, E, CGEN> StreamingCompiler<MCG, FCG, RM, E, CGEN>where
MCG: ModuleCodeGenerator<FCG, RM, E>,
FCG: FunctionCodeGenerator<E>,
RM: RunnableModule + 'static,
E: Debug,
CGEN: Fn() -> MiddlewareChain,
impl<MCG, FCG, RM, E, CGEN> StreamingCompiler<MCG, FCG, RM, E, CGEN>where
MCG: ModuleCodeGenerator<FCG, RM, E>,
FCG: FunctionCodeGenerator<E>,
RM: RunnableModule + 'static,
E: Debug,
CGEN: Fn() -> MiddlewareChain,
Sourcepub fn new(chain_gen: CGEN) -> StreamingCompiler<MCG, FCG, RM, E, CGEN>
pub fn new(chain_gen: CGEN) -> StreamingCompiler<MCG, FCG, RM, E, CGEN>
Create a new StreamingCompiler with the given MiddlewareChain.
Trait Implementations§
Source§impl<MCG, FCG, RM, E, CGEN> Compiler for StreamingCompiler<MCG, FCG, RM, E, CGEN>where
MCG: ModuleCodeGenerator<FCG, RM, E>,
FCG: FunctionCodeGenerator<E>,
RM: RunnableModule + 'static,
E: Debug,
CGEN: Fn() -> MiddlewareChain,
impl<MCG, FCG, RM, E, CGEN> Compiler for StreamingCompiler<MCG, FCG, RM, E, CGEN>where
MCG: ModuleCodeGenerator<FCG, RM, E>,
FCG: FunctionCodeGenerator<E>,
RM: RunnableModule + 'static,
E: Debug,
CGEN: Fn() -> MiddlewareChain,
Source§fn compile(
&self,
wasm: &[u8],
compiler_config: CompilerConfig,
_: Token,
) -> Result<ModuleInner, CompileError>
fn compile( &self, wasm: &[u8], compiler_config: CompilerConfig, _: Token, ) -> Result<ModuleInner, CompileError>
Compiles a
Module from WebAssembly binary format.
The CompileToken parameter ensures that this can only
be called from inside the runtime.unsafe fn from_cache( &self, artifact: Artifact, token: Token, ) -> Result<ModuleInner, Error>
Auto Trait Implementations§
impl<MCG, FCG, RM, E, CGEN> Freeze for StreamingCompiler<MCG, FCG, RM, E, CGEN>where
CGEN: Freeze,
impl<MCG, FCG, RM, E, CGEN> RefUnwindSafe for StreamingCompiler<MCG, FCG, RM, E, CGEN>where
CGEN: RefUnwindSafe,
MCG: RefUnwindSafe,
FCG: RefUnwindSafe,
RM: RefUnwindSafe,
E: RefUnwindSafe,
impl<MCG, FCG, RM, E, CGEN> Send for StreamingCompiler<MCG, FCG, RM, E, CGEN>
impl<MCG, FCG, RM, E, CGEN> Sync for StreamingCompiler<MCG, FCG, RM, E, CGEN>
impl<MCG, FCG, RM, E, CGEN> Unpin for StreamingCompiler<MCG, FCG, RM, E, CGEN>
impl<MCG, FCG, RM, E, CGEN> UnwindSafe for StreamingCompiler<MCG, FCG, RM, E, CGEN>
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