Function
wasmtime_instance_export_get
(
store: WasmtimeStoreContextMut<'_>,
instance: &Instance,
name: *const u8,
name_len: usize,
item: &mut MaybeUninit<wasmtime_extern_t>,
)
Source from the content-addressed store, hash-verified
| 114 | |
| 115 | #[unsafe(no_mangle)] |
| 116 | pub unsafe extern "C" fn wasmtime_instance_export_get( |
| 117 | store: WasmtimeStoreContextMut<'_>, |
| 118 | instance: &Instance, |
| 119 | name: *const u8, |
| 120 | name_len: usize, |
| 121 | item: &mut MaybeUninit<wasmtime_extern_t>, |
| 122 | ) -> bool { |
| 123 | let name = crate::slice_from_raw_parts(name, name_len); |
| 124 | let name = match std::str::from_utf8(name) { |
| 125 | Ok(name) => name, |
| 126 | Err(_) => return false, |
| 127 | }; |
| 128 | match instance.get_export(store, name) { |
| 129 | Some(e) => { |
| 130 | crate::initialize(item, e.into()); |
| 131 | true |
| 132 | } |
| 133 | None => false, |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | #[unsafe(no_mangle)] |
| 138 | pub unsafe extern "C" fn wasmtime_instance_export_nth( |
Tested by
no test coverage detected