MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / wasmtime_integration

Function wasmtime_integration

crates/wiggle/macro/src/lib.rs:197–215  ·  view source on GitHub ↗
(args: TokenStream)

Source from the content-addressed store, hash-verified

195/// * `target`: The path of the module where the Wiggle implementation is defined.
196#[proc_macro]
197pub fn wasmtime_integration(args: TokenStream) -> TokenStream {
198 let config = parse_macro_input!(args as wiggle_generate::WasmtimeConfig);
199 let doc = config.c.load_document();
200
201 let settings = wiggle_generate::CodegenSettings::new(
202 &config.c.errors,
203 &config.c.async_,
204 &doc,
205 true,
206 &config.c.tracing,
207 config.c.mutable,
208 )
209 .expect("validating codegen settings");
210
211 let modules = doc.modules().map(|module| {
212 wiggle_generate::wasmtime::link_module(&module, Some(&config.target), &settings)
213 });
214 quote!( #(#modules)* ).into()
215}

Callers

nothing calls this directly

Calls 6

link_moduleFunction · 0.85
load_documentMethod · 0.80
newFunction · 0.50
expectMethod · 0.45
mapMethod · 0.45
modulesMethod · 0.45

Tested by

no test coverage detected