(
linker: &wasmtime_linker_t,
store: WasmtimeStoreContextMut<'_>,
module: *const u8,
module_len: usize,
name: *const u8,
name_len: usize,
item_ptr: &mut MaybeUninit<wasmtim
| 186 | |
| 187 | #[unsafe(no_mangle)] |
| 188 | pub unsafe extern "C" fn wasmtime_linker_get( |
| 189 | linker: &wasmtime_linker_t, |
| 190 | store: WasmtimeStoreContextMut<'_>, |
| 191 | module: *const u8, |
| 192 | module_len: usize, |
| 193 | name: *const u8, |
| 194 | name_len: usize, |
| 195 | item_ptr: &mut MaybeUninit<wasmtime_extern_t>, |
| 196 | ) -> bool { |
| 197 | let linker = &linker.linker; |
| 198 | let module = match str::from_utf8(crate::slice_from_raw_parts(module, module_len)) { |
| 199 | Ok(s) => s, |
| 200 | Err(_) => return false, |
| 201 | }; |
| 202 | let name = match str::from_utf8(crate::slice_from_raw_parts(name, name_len)) { |
| 203 | Ok(s) => s, |
| 204 | Err(_) => return false, |
| 205 | }; |
| 206 | match linker.get(store, module, name) { |
| 207 | Ok(which) => { |
| 208 | crate::initialize(item_ptr, which.into()); |
| 209 | true |
| 210 | } |
| 211 | Err(_) => false, |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | #[unsafe(no_mangle)] |
| 216 | pub unsafe extern "C" fn wasmtime_linker_define_unknown_imports_as_traps( |
no test coverage detected