mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 21:28:21 +00:00
Implement Exportable for &Ts too (for some T)
This commit is contained in:
12
lib/api/src/externals/function.rs
vendored
12
lib/api/src/externals/function.rs
vendored
@@ -325,6 +325,18 @@ impl<'a> Exportable<'a> for Function {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Exportable<'a> for &'a Function {
|
||||
fn to_export(&self) -> Export {
|
||||
self.exported.clone().into()
|
||||
}
|
||||
fn get_self_from_extern(_extern: &'a Extern) -> Result<Self, ExportError> {
|
||||
match _extern {
|
||||
Extern::Function(func) => Ok(func),
|
||||
_ => Err(ExportError::IncompatibleType),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Function {
|
||||
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user