Creates a new [`Linker`]. The linker will define functions within the context of the `engine` provided and can only instantiate modules for a [`Store`][crate::Store] that is also defined within the same [`Engine`]. Usage of stores with different [`Engine`]s may cause a panic when used with this [`Linker`].
(engine: &Engine)
| 158 | /// that is also defined within the same [`Engine`]. Usage of stores with |
| 159 | /// different [`Engine`]s may cause a panic when used with this [`Linker`]. |
| 160 | pub fn new(engine: &Engine) -> Linker<T> { |
| 161 | Linker { |
| 162 | engine: engine.clone(), |
| 163 | map: TryHashMap::new(), |
| 164 | pool: StringPool::new(), |
| 165 | allow_shadowing: false, |
| 166 | allow_unknown_exports: false, |
| 167 | _marker: marker::PhantomData, |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | /// Returns the [`Engine`] this is connected to. |
| 172 | pub fn engine(&self) -> &Engine { |