MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / convert_module_export

Function convert_module_export

crates/parser/src/conversion.rs:122–134  ·  view source on GitHub ↗
(export: wasmparser::Export<'_>)

Source from the content-addressed store, hash-verified

120}
121
122pub(crate) fn convert_module_export(export: wasmparser::Export<'_>) -> Result<Export> {
123 let kind = match export.kind {
124 wasmparser::ExternalKind::Func => ExternalKind::Func,
125 wasmparser::ExternalKind::Table => ExternalKind::Table,
126 wasmparser::ExternalKind::Memory => ExternalKind::Memory,
127 wasmparser::ExternalKind::Global => ExternalKind::Global,
128 wasmparser::ExternalKind::Tag | wasmparser::ExternalKind::FuncExact => {
129 return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported export kind: {:?}", export.kind)));
130 }
131 };
132
133 Ok(Export { index: export.index, name: Box::from(export.name), kind })
134}
135
136pub(crate) fn convert_module_code(
137 func: wasmparser::FunctionBody<'_>,

Callers 1

process_payloadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected