Trait wasmer_compiler::ModuleMiddleware
source · [−]pub trait ModuleMiddleware: Debug + Send + Sync + MemoryUsage {
fn generate_function_middleware(
&self,
local_function_index: LocalFunctionIndex
) -> Box<dyn FunctionMiddleware>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
;
fn transform_module_info(&self, _: &mut ModuleInfo) { ... }
}
Expand description
A shared builder for function middlewares.
Required methods
fn generate_function_middleware(
&self,
local_function_index: LocalFunctionIndex
) -> Box<dyn FunctionMiddleware>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn generate_function_middleware(
&self,
local_function_index: LocalFunctionIndex
) -> Box<dyn FunctionMiddleware>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Generates a FunctionMiddleware
for a given function.
Here we generate a separate object for each function instead of executing directly on per-function operators,
in order to enable concurrent middleware application. Takes immutable &self
because this function can be called
concurrently from multiple compilation threads.
Provided methods
fn transform_module_info(&self, _: &mut ModuleInfo)
fn transform_module_info(&self, _: &mut ModuleInfo)
Transforms a ModuleInfo
struct in-place. This is called before application on functions begins.