Returns the list of globals and their types exported from this instance.
(&mut self)
| 108 | |
| 109 | /// Returns the list of globals and their types exported from this instance. |
| 110 | pub fn exported_globals(&mut self) -> Vec<(String, DiffValueType)> { |
| 111 | let globals = self |
| 112 | .instance |
| 113 | .exports(&mut self.store) |
| 114 | .filter_map(|e| { |
| 115 | let name = e.name(); |
| 116 | e.into_global().map(|g| (name.to_string(), g)) |
| 117 | }) |
| 118 | .collect::<Vec<_>>(); |
| 119 | |
| 120 | globals |
| 121 | .into_iter() |
| 122 | .filter_map(|(name, global)| { |
| 123 | DiffValueType::try_from(global.ty(&self.store).content().clone()) |
| 124 | .map(|ty| (name, ty)) |
| 125 | .ok() |
| 126 | }) |
| 127 | .collect() |
| 128 | } |
| 129 | |
| 130 | /// Returns the list of exported memories and whether or not it's a shared |
| 131 | /// memory. |