Impl Debug for SharedMemory and Extern (#5211)

This commit is contained in:
Alphyr
2022-11-07 16:05:59 +01:00
committed by GitHub
parent 08ef518c95
commit 508dd81928
2 changed files with 7 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ use wasmtime_runtime::{self as runtime, InstanceHandle};
/// as well as required by [`Instance::new`](crate::Instance::new). In other
/// words, this is the type of extracted values from an instantiated module, and
/// it's also used to provide imported values when instantiating a module.
#[derive(Clone)]
#[derive(Clone, Debug)]
pub enum Extern {
/// A WebAssembly `func` which can be called.
Func(Func),

View File

@@ -818,6 +818,12 @@ impl SharedMemory {
}
}
impl std::fmt::Debug for SharedMemory {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SharedMemory").finish_non_exhaustive()
}
}
#[cfg(test)]
mod tests {
use crate::*;