mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-06 20:58:28 +00:00
Implement Exportable for &Ts too (for some T)
This commit is contained in:
17
lib/api/src/externals/mod.rs
vendored
17
lib/api/src/externals/mod.rs
vendored
@@ -52,11 +52,26 @@ impl<'a> Exportable<'a> for Extern {
|
||||
}
|
||||
|
||||
fn get_self_from_extern(_extern: &'a Extern) -> Result<Self, ExportError> {
|
||||
// Since this is already an extern, we can just return it.
|
||||
Ok(_extern.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Exportable<'a> for &'a Extern {
|
||||
fn to_export(&self) -> Export {
|
||||
match self {
|
||||
Extern::Function(f) => f.to_export(),
|
||||
Extern::Global(g) => g.to_export(),
|
||||
Extern::Memory(m) => m.to_export(),
|
||||
Extern::Table(t) => t.to_export(),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_self_from_extern(_extern: &'a Extern) -> Result<Self, ExportError> {
|
||||
// Since this is already an extern, we can just return it.
|
||||
Ok(_extern)
|
||||
}
|
||||
}
|
||||
|
||||
impl StoreObject for Extern {
|
||||
fn comes_from_same_store(&self, store: &Store) -> bool {
|
||||
let my_store = match self {
|
||||
|
||||
Reference in New Issue
Block a user