Added Debug to public structs. Close #173

This commit is contained in:
Syrus
2020-07-21 20:38:32 -07:00
parent e1838ff59b
commit 1293df8dd6
11 changed files with 123 additions and 18 deletions

View File

@@ -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)