(
mut cx: WasmtimeStoreContextMut<'_>,
anyref: Option<&wasmtime_anyref_t>,
out: &mut MaybeUninit<wasmtime_arrayref_t>,
)
| 276 | |
| 277 | #[unsafe(no_mangle)] |
| 278 | pub unsafe extern "C" fn wasmtime_anyref_as_array( |
| 279 | mut cx: WasmtimeStoreContextMut<'_>, |
| 280 | anyref: Option<&wasmtime_anyref_t>, |
| 281 | out: &mut MaybeUninit<wasmtime_arrayref_t>, |
| 282 | ) -> bool { |
| 283 | if let Some(anyref) = anyref.and_then(|a| a.as_wasmtime()) { |
| 284 | let mut scope = RootScope::new(&mut cx); |
| 285 | let rooted = anyref.to_rooted(&mut scope); |
| 286 | if let Ok(Some(arrayref)) = rooted.as_array(&scope) { |
| 287 | let owned = arrayref.to_owned_rooted(&mut scope).expect("in scope"); |
| 288 | crate::initialize(out, Some(owned).into()); |
| 289 | return true; |
| 290 | } |
| 291 | } |
| 292 | crate::initialize(out, None::<OwnedRooted<ArrayRef>>.into()); |
| 293 | false |
| 294 | } |
| 295 | |
| 296 | #[unsafe(no_mangle)] |
| 297 | pub unsafe extern "C" fn wasmtime_anyref_type( |
no test coverage detected