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

Method from

crates/c-api/src/component/types/component.rs:131–149  ·  view source on GitHub ↗
(item: ComponentItem)

Source from the content-addressed store, hash-verified

129
130impl From<ComponentItem> for wasmtime_component_item_t {
131 fn from(item: ComponentItem) -> Self {
132 match item {
133 ComponentItem::Component(ty) => {
134 wasmtime_component_item_t::Component(Box::new(ty.into()))
135 }
136 ComponentItem::ComponentInstance(ty) => {
137 wasmtime_component_item_t::ComponentInstance(Box::new(ty.into()))
138 }
139 ComponentItem::Module(ty) => wasmtime_component_item_t::Module(Box::new(ty.into())),
140 ComponentItem::ComponentFunc(ty) => {
141 wasmtime_component_item_t::ComponentFunc(Box::new(ty.into()))
142 }
143 ComponentItem::Resource(ty) => wasmtime_component_item_t::Resource(Box::new(ty.into())),
144 ComponentItem::CoreFunc(ty) => {
145 wasmtime_component_item_t::CoreFunc(Box::new(wasm_functype_t::new(ty)))
146 }
147 ComponentItem::Type(ty) => wasmtime_component_item_t::Type(ty.into()),
148 }
149 }
150}
151
152#[unsafe(no_mangle)]

Callers

nothing calls this directly

Calls 7

ComponentFuncClass · 0.85
ComponentClass · 0.50
newFunction · 0.50
ComponentInstanceClass · 0.50
ModuleClass · 0.50
ResourceClass · 0.50
TypeEnum · 0.50

Tested by

no test coverage detected