(item: ComponentItem)
| 129 | |
| 130 | impl 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)] |
nothing calls this directly
no test coverage detected