| 110 | |
| 111 | #[unsafe(no_mangle)] |
| 112 | pub unsafe extern "C" fn wasmtime_arrayref_set( |
| 113 | mut cx: WasmtimeStoreContextMut<'_>, |
| 114 | arrayref: Option<&wasmtime_arrayref_t>, |
| 115 | index: u32, |
| 116 | val: &crate::wasmtime_val_t, |
| 117 | ) -> Option<Box<crate::wasmtime_error_t>> { |
| 118 | let arrayref = arrayref |
| 119 | .and_then(|a| a.as_wasmtime()) |
| 120 | .expect("non-null arrayref required"); |
| 121 | let mut scope = RootScope::new(&mut cx); |
| 122 | let rooted = arrayref.to_rooted(&mut scope); |
| 123 | let rust_val = val.to_val(&mut scope); |
| 124 | match rooted.set(&mut scope, index, rust_val) { |
| 125 | Ok(()) => None, |
| 126 | Err(e) => Some(Box::new(e.into())), |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | #[unsafe(no_mangle)] |
| 131 | pub unsafe extern "C" fn wasmtime_arrayref_type( |