wasmtime/runtime/component/
store.rs1use crate::prelude::*;
2use crate::store::{StoreData, StoredData};
3
4macro_rules! component_store_data {
5 ($($field:ident => $t:ty,)*) => (
6 #[derive(Default)]
7 pub struct ComponentStoreData {
8 $($field: Vec<$t>,)*
9 }
10
11 $(
12 impl StoredData for $t {
13 #[inline]
14 fn list(data: &StoreData) -> &Vec<Self> {
15 &data.components.$field
16 }
17 #[inline]
18 fn list_mut(data: &mut StoreData) -> &mut Vec<Self> {
19 &mut data.components.$field
20 }
21 }
22 )*
23 )
24}
25
26component_store_data! {
27 funcs => crate::component::func::FuncData,
28 instances => Option<Box<crate::component::instance::InstanceData>>,
29}