Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
490: Add MiddlewareChain and StreamingCompiler to runtime r=syrusakbary a=bjfish It would be nice to add `MiddlewareChain` and `StreamingCompiler` to runtime to be able to use these without having to include the `runtime-core` as a dependency. For example: ```rust use wasmer_runtime::{MiddlewareChain, StreamingCompiler}; use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG; use wasmer_middleware_common::metering::Metering; let limit = 1_000_000; let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || { let mut chain = MiddlewareChain::new(); chain.push(Metering::new(limit)); chain }); wasmer_runtime::compile_with(&prepared_code, &c) .map_err(|e| Error::Wasmer(format!("{}", e))) chain }); wasmer_runtime::compile_with(&prepared_code, &c) .map_err(|e| Error::Wasmer(format!("{}", e))) ``` Co-authored-by: Brandon Fish <[email protected]>
- Loading branch information