Skip to main content

WatElementType

Enum WatElementType 

Source
#[repr(u8)]
pub enum WatElementType {
Show 162 variants Whitespace = 0, Newline = 1, Comment = 2, Error = 3, Eof = 4, Text = 5, IntegerLiteral = 6, FloatLiteral = 7, StringLiteral = 8, Identifier = 9, ModuleKw = 10, FuncKw = 11, ExportKw = 12, ImportKw = 13, TypeKw = 14, ParamKw = 15, ResultKw = 16, LocalKw = 17, GlobalKw = 18, MemoryKw = 19, TableKw = 20, ElemKw = 21, DataKw = 22, StartKw = 23, BlockKw = 24, LoopKw = 25, IfKw = 26, ThenKw = 27, ElseKw = 28, EndKw = 29, BrKw = 30, BrIfKw = 31, BrTableKw = 32, ReturnKw = 33, CallKw = 34, CallIndirectKw = 35, LocalGetKw = 36, LocalSetKw = 37, LocalTeeKw = 38, GlobalGetKw = 39, GlobalSetKw = 40, I32LoadKw = 41, I64LoadKw = 42, F32LoadKw = 43, F64LoadKw = 44, I32Load8SKw = 45, I32Load8UKw = 46, I32Load16SKw = 47, I32Load16UKw = 48, I64Load8SKw = 49, I64Load8UKw = 50, I64Load16SKw = 51, I64Load16UKw = 52, I64Load32SKw = 53, I64Load32UKw = 54, I32StoreKw = 55, I64StoreKw = 56, F32StoreKw = 57, F64StoreKw = 58, I32Store8Kw = 59, I32Store16Kw = 60, I64Store8Kw = 61, I64Store16Kw = 62, I64Store32Kw = 63, MemorySizeKw = 64, MemoryGrowKw = 65, I32ConstKw = 66, I64ConstKw = 67, F32ConstKw = 68, F64ConstKw = 69, I32AddKw = 70, I64AddKw = 71, F32AddKw = 72, F64AddKw = 73, I32SubKw = 74, I64SubKw = 75, F32SubKw = 76, F64SubKw = 77, I32MulKw = 78, I64MulKw = 79, F32MulKw = 80, F64MulKw = 81, I32DivSKw = 82, I32DivUKw = 83, I64DivSKw = 84, I64DivUKw = 85, F32DivKw = 86, F64DivKw = 87, I32RemSKw = 88, I32RemUKw = 89, I64RemSKw = 90, I64RemUKw = 91, I32AndKw = 92, I64AndKw = 93, I32OrKw = 94, I64OrKw = 95, I32XorKw = 96, I64XorKw = 97, I32ShlKw = 98, I64ShlKw = 99, I32ShrSKw = 100, I32ShrUKw = 101, I64ShrSKw = 102, I64ShrUKw = 103, I32RotlKw = 104, I64RotlKw = 105, I32RotrKw = 106, I64RotrKw = 107, I32EqKw = 108, I64EqKw = 109, F32EqKw = 110, F64EqKw = 111, I32NeKw = 112, I64NeKw = 113, F32NeKw = 114, F64NeKw = 115, I32LtSKw = 116, I32LtUKw = 117, I64LtSKw = 118, I64LtUKw = 119, F32LtKw = 120, F64LtKw = 121, I32GtSKw = 122, I32GtUKw = 123, I64GtSKw = 124, I64GtUKw = 125, F32GtKw = 126, F64GtKw = 127, I32LeSKw = 128, I32LeUKw = 129, I64LeSKw = 130, I64LeUKw = 131, F32LeKw = 132, F64LeKw = 133, I32GeSKw = 134, I32GeUKw = 135, I64GeSKw = 136, I64GeUKw = 137, F32GeKw = 138, F64GeKw = 139, LeftParen = 140, RightParen = 141, Module = 142, Func = 143, Export = 144, Import = 145, Type = 146, Param = 147, Result = 148, Local = 149, Global = 150, Memory = 151, Table = 152, Elem = 153, Data = 154, Start = 155, Block = 156, Loop = 157, If = 158, Instruction = 159, Root = 160, Item = 161,
}
Expand description

Element types for the WebAssembly Text (WAT) format.

Variants§

§

Whitespace = 0

Whitespace.

§

Newline = 1

Newline.

§

Comment = 2

A comment.

§

Error = 3

An error token.

§

Eof = 4

End of stream.

§

Text = 5

Text.

§

IntegerLiteral = 6

An integer literal.

§

FloatLiteral = 7

A floating-point literal.

§

StringLiteral = 8

A string literal.

§

Identifier = 9

An identifier.

§

ModuleKw = 10

module keyword.

§

FuncKw = 11

func keyword.

§

ExportKw = 12

export keyword.

§

ImportKw = 13

import keyword.

§

TypeKw = 14

type keyword.

§

ParamKw = 15

param keyword.

§

ResultKw = 16

result keyword.

§

LocalKw = 17

local keyword.

§

GlobalKw = 18

global keyword.

§

MemoryKw = 19

memory keyword.

§

TableKw = 20

table keyword.

§

ElemKw = 21

elem keyword.

§

DataKw = 22

data keyword.

§

StartKw = 23

start keyword.

§

BlockKw = 24

block keyword.

§

LoopKw = 25

loop keyword.

§

IfKw = 26

if keyword.

§

ThenKw = 27

then keyword.

§

ElseKw = 28

else keyword.

§

EndKw = 29

end keyword.

§

BrKw = 30

br keyword.

§

BrIfKw = 31

br_if keyword.

§

BrTableKw = 32

br_table keyword.

§

ReturnKw = 33

return keyword.

§

CallKw = 34

call keyword.

§

CallIndirectKw = 35

call_indirect keyword.

§

LocalGetKw = 36

local.get keyword.

§

LocalSetKw = 37

local.set keyword.

§

LocalTeeKw = 38

local.tee keyword.

§

GlobalGetKw = 39

global.get keyword.

§

GlobalSetKw = 40

global.set keyword.

§

I32LoadKw = 41

i32.load keyword.

§

I64LoadKw = 42

i64.load keyword.

§

F32LoadKw = 43

f32.load keyword.

§

F64LoadKw = 44

f64.load keyword.

§

I32Load8SKw = 45

i32.load8_s keyword.

§

I32Load8UKw = 46

i32.load8_u keyword.

§

I32Load16SKw = 47

i32.load16_s keyword.

§

I32Load16UKw = 48

i32.load16_u keyword.

§

I64Load8SKw = 49

i64.load8_s keyword.

§

I64Load8UKw = 50

i64.load8_u keyword.

§

I64Load16SKw = 51

i64.load16_s keyword.

§

I64Load16UKw = 52

i64.load16_u keyword.

§

I64Load32SKw = 53

i64.load32_s keyword.

§

I64Load32UKw = 54

i64.load32_u keyword.

§

I32StoreKw = 55

i32.store keyword.

§

I64StoreKw = 56

i64.store keyword.

§

F32StoreKw = 57

f32.store keyword.

§

F64StoreKw = 58

f64.store keyword.

§

I32Store8Kw = 59

i32.store8 keyword.

§

I32Store16Kw = 60

i32.store16 keyword.

§

I64Store8Kw = 61

i64.store8 keyword.

§

I64Store16Kw = 62

i64.store16 keyword.

§

I64Store32Kw = 63

i64.store32 keyword.

§

MemorySizeKw = 64

memory.size keyword.

§

MemoryGrowKw = 65

memory.grow keyword.

§

I32ConstKw = 66

i32.const keyword.

§

I64ConstKw = 67

i64.const keyword.

§

F32ConstKw = 68

f32.const keyword.

§

F64ConstKw = 69

f64.const keyword.

§

I32AddKw = 70

i32.add keyword.

§

I64AddKw = 71

i64.add keyword.

§

F32AddKw = 72

f32.add keyword.

§

F64AddKw = 73

f64.add keyword.

§

I32SubKw = 74

i32.sub keyword.

§

I64SubKw = 75

i64.sub keyword.

§

F32SubKw = 76

f32.sub keyword.

§

F64SubKw = 77

f64.sub keyword.

§

I32MulKw = 78

i32.mul keyword.

§

I64MulKw = 79

i64.mul keyword.

§

F32MulKw = 80

f32.mul keyword.

§

F64MulKw = 81

f64.mul keyword.

§

I32DivSKw = 82

i32.div_s keyword.

§

I32DivUKw = 83

i32.div_u keyword.

§

I64DivSKw = 84

i64.div_s keyword.

§

I64DivUKw = 85

i64.div_u keyword.

§

F32DivKw = 86

f32.div keyword.

§

F64DivKw = 87

f64.div keyword.

§

I32RemSKw = 88

i32.rem_s keyword.

§

I32RemUKw = 89

i32.rem_u keyword.

§

I64RemSKw = 90

i64.rem_s keyword.

§

I64RemUKw = 91

i64.rem_u keyword.

§

I32AndKw = 92

i32.and keyword.

§

I64AndKw = 93

i64.and keyword.

§

I32OrKw = 94

i32.or keyword.

§

I64OrKw = 95

i64.or keyword.

§

I32XorKw = 96

i32.xor keyword.

§

I64XorKw = 97

i64.xor keyword.

§

I32ShlKw = 98

i32.shl keyword.

§

I64ShlKw = 99

i64.shl keyword.

§

I32ShrSKw = 100

i32.shr_s keyword.

§

I32ShrUKw = 101

i32.shr_u keyword.

§

I64ShrSKw = 102

i64.shr_s keyword.

§

I64ShrUKw = 103

i64.shr_u keyword.

§

I32RotlKw = 104

i32.rotl keyword.

§

I64RotlKw = 105

i64.rotl keyword.

§

I32RotrKw = 106

i32.rotr keyword.

§

I64RotrKw = 107

i64.rotr keyword.

§

I32EqKw = 108

i32.eq keyword.

§

I64EqKw = 109

i64.eq keyword.

§

F32EqKw = 110

f32.eq keyword.

§

F64EqKw = 111

f64.eq keyword.

§

I32NeKw = 112

i32.ne keyword.

§

I64NeKw = 113

i64.ne keyword.

§

F32NeKw = 114

f32.ne keyword.

§

F64NeKw = 115

f64.ne keyword.

§

I32LtSKw = 116

i32.lt_s keyword.

§

I32LtUKw = 117

i32.lt_u keyword.

§

I64LtSKw = 118

i64.lt_s keyword.

§

I64LtUKw = 119

i64.lt_u keyword.

§

F32LtKw = 120

f32.lt keyword.

§

F64LtKw = 121

f64.lt keyword.

§

I32GtSKw = 122

i32.gt_s keyword.

§

I32GtUKw = 123

i32.gt_u keyword.

§

I64GtSKw = 124

i64.gt_s keyword.

§

I64GtUKw = 125

i64.gt_u keyword.

§

F32GtKw = 126

f32.gt keyword.

§

F64GtKw = 127

f64.gt keyword.

§

I32LeSKw = 128

i32.le_s keyword.

§

I32LeUKw = 129

i32.le_u keyword.

§

I64LeSKw = 130

i64.le_s keyword.

§

I64LeUKw = 131

i64.le_u keyword.

§

F32LeKw = 132

f32.le keyword.

§

F64LeKw = 133

f64.le keyword.

§

I32GeSKw = 134

i32.ge_s keyword.

§

I32GeUKw = 135

i32.ge_u keyword.

§

I64GeSKw = 136

i64.ge_s keyword.

§

I64GeUKw = 137

i64.ge_u keyword.

§

F32GeKw = 138

f32.ge keyword.

§

F64GeKw = 139

f64.ge keyword.

§

LeftParen = 140

(.

§

RightParen = 141

).

§

Module = 142

A WebAssembly module.

§

Func = 143

A function.

§

Export = 144

An export.

§

Import = 145

An import.

§

Type = 146

A type definition.

§

Param = 147

A parameter.

§

Result = 148

A result.

§

Local = 149

A local variable.

§

Global = 150

A global variable.

§

Memory = 151

Memory definition.

§

Table = 152

Table definition.

§

Elem = 153

Element segment.

§

Data = 154

Data segment.

§

Start = 155

Start function.

§

Block = 156

A block.

§

Loop = 157

A loop.

§

If = 158

An if statement.

§

Instruction = 159

An instruction.

§

Root = 160

Root node.

§

Item = 161

A generic item.

Implementations§

Source§

impl WatElementType

Source

pub fn from_keyword(text: &str) -> Option<WatElementType>

Returns the element type for the given keyword.

Trait Implementations§

Source§

impl Clone for WatElementType

Source§

fn clone(&self) -> WatElementType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WatElementType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WatElementType

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<WatElementType, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl ElementType for WatElementType

Source§

type Role = UniversalElementRole

The associated role type for this element kind.
Source§

fn role(&self) -> <WatElementType as ElementType>::Role

Returns the general syntactic role of this element.
Source§

fn is_role(&self, role: Self::Role) -> bool

Returns true if this element matches the specified language-specific role.
Source§

fn is_universal(&self, role: UniversalElementRole) -> bool

Returns true if this element matches the specified universal role.
Source§

fn is_root(&self) -> bool

Returns true if this element represents the root of the parsed tree.
Source§

fn is_error(&self) -> bool

Returns true if this element represents an error condition.
Source§

impl From<WatTokenType> for WatElementType

Source§

fn from(token: WatTokenType) -> WatElementType

Converts to this type from the input type.
Source§

impl Hash for WatElementType

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for WatElementType

Source§

fn eq(&self, other: &WatElementType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for WatElementType

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for WatElementType

Source§

impl Eq for WatElementType

Source§

impl StructuralPartialEq for WatElementType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,