Skip to main content

WasmInstr

Enum WasmInstr 

Source
pub enum WasmInstr {
Show 39 variants LocalGet(String), LocalSet(String), I32Const(i32), I64Const(i64), F64Const(f64), Call(String), CallIndirect, Return, BrIf(u32), Block, Loop, End, Drop, Select, Nop, Unreachable, I32Add, I32Sub, I32Mul, I32DivS, I64Add, I64Mul, F64Add, F64Mul, F64Div, F64Sqrt, MemLoad(u32), MemStore(u32), I32Eqz, I32Eq, I32Ne, I32LtS, I32GtS, I32LeS, I32GeS, RefNull, RefIsNull, TableGet(u32), TableSet(u32),
}
Expand description

WebAssembly instructions for the WAT text format.

Variants§

§

LocalGet(String)

Get local variable: local.get $name

§

LocalSet(String)

Set local variable: local.set $name

§

I32Const(i32)

32-bit integer constant: i32.const N

§

I64Const(i64)

64-bit integer constant: i64.const N

§

F64Const(f64)

64-bit float constant: f64.const N

§

Call(String)

Direct function call: call $name

§

CallIndirect

Indirect function call via table: call_indirect

§

Return

Return from function: return

§

BrIf(u32)

Branch if condition is true: br_if N

§

Block

Begin a block: block

§

Loop

Begin a loop: loop

§

End

End a block/loop/function: end

§

Drop

Drop top of stack: drop

§

Select

Select one of two values based on condition: select

§

Nop

No-op: nop

§

Unreachable

Trap unconditionally: unreachable

§

I32Add

i32.add

§

I32Sub

i32.sub

§

I32Mul

i32.mul

§

I32DivS

i32.div_s

§

I64Add

i64.add

§

I64Mul

i64.mul

§

F64Add

f64.add

§

F64Mul

f64.mul

§

F64Div

f64.div

§

F64Sqrt

f64.sqrt

§

MemLoad(u32)

Load from linear memory with alignment: i32.load align=N

§

MemStore(u32)

Store to linear memory with alignment: i32.store align=N

§

I32Eqz

i32.eqz

§

I32Eq

i32.eq

§

I32Ne

i32.ne

§

I32LtS

i32.lt_s

§

I32GtS

i32.gt_s

§

I32LeS

i32.le_s

§

I32GeS

i32.ge_s

§

RefNull

Null reference: ref.null funcref

§

RefIsNull

Test if reference is null: ref.is_null

§

TableGet(u32)

Get element from table: table.get N

§

TableSet(u32)

Set element in table: table.set N

Trait Implementations§

Source§

impl Clone for WasmInstr

Source§

fn clone(&self) -> WasmInstr

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 WasmInstr

Source§

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

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

impl Display for WasmInstr

Source§

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

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

impl PartialEq for WasmInstr

Source§

fn eq(&self, other: &WasmInstr) -> 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 StructuralPartialEq for WasmInstr

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, 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.