Merge pull request #886 from alexcrichton/debug-config
Add a `Debug` implementation for `wsmtime::Config`
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
use std::fmt;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use wasmtime_environ::settings::{self, Configurable};
|
use wasmtime_environ::settings::{self, Configurable};
|
||||||
@@ -223,6 +224,20 @@ impl Default for Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for Config {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
f.debug_struct("Config")
|
||||||
|
.field("debug_info", &self.debug_info)
|
||||||
|
.field("strategy", &self.strategy)
|
||||||
|
.field("features", &self.features)
|
||||||
|
.field(
|
||||||
|
"flags",
|
||||||
|
&settings::Flags::new(self.flags.clone()).to_string(),
|
||||||
|
)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Possible Compilation strategies for a wasm module.
|
/// Possible Compilation strategies for a wasm module.
|
||||||
///
|
///
|
||||||
/// This is used as an argument to the [`Config::strategy`] method.
|
/// This is used as an argument to the [`Config::strategy`] method.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ pub enum ContextError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The collection of features configurable during compilation
|
/// The collection of features configurable during compilation
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default, Debug)]
|
||||||
pub struct Features {
|
pub struct Features {
|
||||||
/// marks whether the proposed thread feature is enabled or disabled
|
/// marks whether the proposed thread feature is enabled or disabled
|
||||||
pub threads: bool,
|
pub threads: bool,
|
||||||
|
|||||||
Reference in New Issue
Block a user