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

Function parse

crates/wizer/src/component/parse.rs:22–27  ·  view source on GitHub ↗

Parse the given Wasm bytes into a `ComponentContext` tree. This will parse the input component and build up metadata that Wizer needs to know about the component. At this time there are limitations to this parsing phase which in theory could be lifted in the future but serve as simplifying assumptions for now: Nested components with modules are not supported. Imported modules or components are n

(full_wasm: &'a [u8])

Source from the content-addressed store, hash-verified

20///
21/// Some of these restrictions are likely to be loosened over time, however.
22pub(crate) fn parse<'a>(full_wasm: &'a [u8]) -> wasmtime::Result<ComponentContext<'a>> {
23 let mut component = ComponentContext::default();
24 let parser = Parser::new(0).parse_all(full_wasm);
25 parse_into(Some(&mut component), full_wasm, parser)?;
26 Ok(component)
27}
28
29fn parse_into<'a>(
30 mut cx: Option<&mut ComponentContext<'a>>,

Callers

nothing calls this directly

Calls 3

parse_intoFunction · 0.85
OkFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected