pub enum WastDirective<'a> {
Show 15 variants
Module(QuoteWat<'a>),
ModuleDefinition(QuoteWat<'a>),
ModuleInstance {
span: Span,
instance: Option<Id<'a>>,
module: Option<Id<'a>>,
},
AssertMalformed {
span: Span,
module: QuoteWat<'a>,
message: &'a str,
},
AssertInvalid {
span: Span,
module: QuoteWat<'a>,
message: &'a str,
},
Register {
span: Span,
name: &'a str,
module: Option<Id<'a>>,
},
Invoke(WastInvoke<'a>),
AssertTrap {
span: Span,
exec: WastExecute<'a>,
message: &'a str,
},
AssertReturn {
span: Span,
exec: WastExecute<'a>,
results: Vec<WastRet<'a>>,
},
AssertExhaustion {
span: Span,
call: WastInvoke<'a>,
message: &'a str,
},
AssertUnlinkable {
span: Span,
module: Wat<'a>,
message: &'a str,
},
AssertException {
span: Span,
exec: WastExecute<'a>,
},
AssertSuspension {
span: Span,
exec: WastExecute<'a>,
message: &'a str,
},
Thread(WastThread<'a>),
Wait {
span: Span,
thread: Id<'a>,
},
}
Expand description
The different kinds of directives found in a *.wast
file.
Some more information about these various branches can be found at https://github.com/WebAssembly/spec/blob/main/interpreter/README.md#scripts.
Variants§
Module(QuoteWat<'a>)
The provided module is defined, validated, and then instantiated.
ModuleDefinition(QuoteWat<'a>)
The provided module is defined and validated.
This module is not instantiated automatically.
ModuleInstance
The named module is instantiated under the instance name provided.
AssertMalformed
Asserts the module cannot be decoded with the given error.
AssertInvalid
Asserts the module cannot be validated with the given error.
Register
Registers the module
instance with the given name
to be available
for importing in future module instances.
Invoke(WastInvoke<'a>)
Invokes the specified export.
AssertTrap
The invocation provided should trap with the specified error.
AssertReturn
The invocation provided should succeed with the specified results.
AssertExhaustion
The invocation provided should exhaust system resources (e.g. stack overflow).
AssertUnlinkable
The provided module should fail to link when instantiation is attempted.
AssertException
The invocation provided should throw an exception.
AssertSuspension
The invocation should fail to handle a suspension.
Thread(WastThread<'a>)
Creates a new system thread which executes the given commands.
Wait
Waits for the specified thread to exit.