pub enum WastDirective<'a> {
    Module(Module<'a>),
    QuoteModule {
        span: Span,
        source: Vec<&'a [u8]>,
    },
    AssertMalformed {
        span: Span,
        module: QuoteModule<'a>,
        message: &'a str,
    },
    AssertInvalid {
        span: Span,
        module: QuoteModule<'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<AssertExpression<'a>>,
    },
    AssertExhaustion {
        span: Span,
        call: WastInvoke<'a>,
        message: &'a str,
    },
    AssertUnlinkable {
        span: Span,
        module: Module<'a>,
        message: &'a str,
    },
    AssertException {
        span: Span,
        exec: WastExecute<'a>,
    },
}
Expand description

The different kinds of directives found in a *.wast file.

It’s not entirely clear to me what all of these are per se, but they’re only really interesting to test harnesses mostly.

Variants

Module(Module<'a>)

QuoteModule

Fields

span: Span
source: Vec<&'a [u8]>

AssertMalformed

Fields

span: Span
module: QuoteModule<'a>
message: &'a str

AssertInvalid

Fields

span: Span
module: QuoteModule<'a>
message: &'a str

Register

Fields

span: Span
name: &'a str
module: Option<Id<'a>>

Invoke(WastInvoke<'a>)

AssertTrap

Fields

span: Span
exec: WastExecute<'a>
message: &'a str

AssertReturn

Fields

span: Span
exec: WastExecute<'a>
results: Vec<AssertExpression<'a>>

AssertExhaustion

Fields

span: Span
call: WastInvoke<'a>
message: &'a str

AssertUnlinkable

Fields

span: Span
module: Module<'a>
message: &'a str

AssertException

Fields

span: Span
exec: WastExecute<'a>

Implementations

Returns the location in the source that this directive was defined at

Trait Implementations

Formats the value using the given formatter. Read more

Attempts to parse Self from parser, returning an error if it could not be parsed. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.