pub struct WastContext { /* private fields */ }
Expand description
The wast test script language allows modules to be defined and actions to be performed on them.
Implementations§
Source§impl WastContext
impl WastContext
Sourcepub fn new(
engine: &Engine,
async_: Async,
configure: impl Fn(&mut Store<()>) + Send + Sync + 'static,
) -> Self
pub fn new( engine: &Engine, async_: Async, configure: impl Fn(&mut Store<()>) + Send + Sync + 'static, ) -> Self
Construct a new instance of WastContext
.
The engine
provided is used for all store/module/component creation
and should be appropriately configured by the caller. The async_
configuration indicates whether functions are invoked either async or
sync, and then the configure
callback is used whenever a store is
created to further configure its settings.
Sourcepub fn precompile_save(&mut self, path: impl AsRef<Path>) -> &mut Self
pub fn precompile_save(&mut self, path: impl AsRef<Path>) -> &mut Self
Saves precompiled modules/components into path
instead of executing
test directives.
Sourcepub fn precompile_load(&mut self, path: impl AsRef<Path>) -> &mut Self
pub fn precompile_load(&mut self, path: impl AsRef<Path>) -> &mut Self
Loads precompiled modules/components from path
instead of compiling
natively.
Sourcepub fn register_spectest(&mut self, config: &SpectestConfig) -> Result<()>
pub fn register_spectest(&mut self, config: &SpectestConfig) -> Result<()>
Register “spectest” which is used by the spec testsuite.
Sourcepub fn run_wast(&mut self, filename: &str, wast: &[u8]) -> Result<()>
pub fn run_wast(&mut self, filename: &str, wast: &[u8]) -> Result<()>
Run a wast script from a byte buffer.
Sourcepub fn generate_dwarf(&mut self, enable: bool) -> &mut Self
pub fn generate_dwarf(&mut self, enable: bool) -> &mut Self
Whether or not to generate DWARF debugging information in custom sections in modules being tested.
Auto Trait Implementations§
impl !Freeze for WastContext
impl !RefUnwindSafe for WastContext
impl Send for WastContext
impl Sync for WastContext
impl Unpin for WastContext
impl !UnwindSafe for WastContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more