mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 05:08:19 +00:00
Added Debug to public structs. Close #173
This commit is contained in:
16
lib/api/src/externals/mod.rs
vendored
16
lib/api/src/externals/mod.rs
vendored
@@ -13,6 +13,7 @@ pub use self::table::Table;
|
||||
use crate::exports::{ExportError, Exportable};
|
||||
use crate::store::{Store, StoreObject};
|
||||
use crate::ExternType;
|
||||
use std::fmt;
|
||||
use wasmer_vm::Export;
|
||||
|
||||
/// An `Extern` is the runtime representation of an entity that
|
||||
@@ -81,6 +82,21 @@ impl StoreObject for Extern {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Extern {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
match self {
|
||||
Self::Function(_) => "Function(...)",
|
||||
Self::Global(_) => "Global(...)",
|
||||
Self::Memory(_) => "Memory(...)",
|
||||
Self::Table(_) => "Table(...)",
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Function> for Extern {
|
||||
fn from(r: Function) -> Self {
|
||||
Extern::Function(r)
|
||||
|
||||
Reference in New Issue
Block a user