Enum walrus::ir::Instr

source ·
pub enum Instr {
Show 48 variants Block(Block), Loop(Loop), Call(Call), CallIndirect(CallIndirect), LocalGet(LocalGet), LocalSet(LocalSet), LocalTee(LocalTee), GlobalGet(GlobalGet), GlobalSet(GlobalSet), Const(Const), Binop(Binop), Unop(Unop), Select(Select), Unreachable(Unreachable), Br(Br), BrIf(BrIf), IfElse(IfElse), BrTable(BrTable), Drop(Drop), Return(Return), MemorySize(MemorySize), MemoryGrow(MemoryGrow), MemoryInit(MemoryInit), DataDrop(DataDrop), MemoryCopy(MemoryCopy), MemoryFill(MemoryFill), Load(Load), Store(Store), AtomicRmw(AtomicRmw), Cmpxchg(Cmpxchg), AtomicNotify(AtomicNotify), AtomicWait(AtomicWait), AtomicFence(AtomicFence), TableGet(TableGet), TableSet(TableSet), TableGrow(TableGrow), TableSize(TableSize), TableFill(TableFill), RefNull(RefNull), RefIsNull(RefIsNull), RefFunc(RefFunc), V128Bitselect(V128Bitselect), I8x16Swizzle(I8x16Swizzle), I8x16Shuffle(I8x16Shuffle), LoadSimd(LoadSimd), TableInit(TableInit), ElemDrop(ElemDrop), TableCopy(TableCopy),
}
Expand description

An enum of all the different kinds of wasm instructions.

Note that the #[walrus_expr] macro rewrites this enum’s variants from

enum Instr {
    Variant { field: Ty, .. },
    ...
}

into

enum Instr {
    Variant(Variant),
    ...
}

struct Variant {
    field: Ty,
    ...
}

Variants§

§

Block(Block)

block ... end

§

Loop(Loop)

loop ... end

§

Call(Call)

call

§

CallIndirect(CallIndirect)

call_indirect

§

LocalGet(LocalGet)

local.get n

§

LocalSet(LocalSet)

local.set n

§

LocalTee(LocalTee)

local.tee n

§

GlobalGet(GlobalGet)

global.get n

§

GlobalSet(GlobalSet)

global.set n

§

Const(Const)

*.const

§

Binop(Binop)

Binary operations, those requiring two operands

§

Unop(Unop)

Unary operations, those requiring one operand

§

Select(Select)

select

§

Unreachable(Unreachable)

unreachable

§

Br(Br)

br

§

BrIf(BrIf)

br_if

§

IfElse(IfElse)

if <consequent> else <alternative> end

§

BrTable(BrTable)

br_table

§

Drop(Drop)

drop

§

Return(Return)

return

§

MemorySize(MemorySize)

memory.size

§

MemoryGrow(MemoryGrow)

memory.grow

§

MemoryInit(MemoryInit)

memory.init

§

DataDrop(DataDrop)

data.drop

§

MemoryCopy(MemoryCopy)

memory.copy

§

MemoryFill(MemoryFill)

memory.fill

§

Load(Load)

*.load

Loading a value from memory.

§

Store(Store)

*.store

Storing a value to memory.

§

AtomicRmw(AtomicRmw)

An atomic read/modify/write operation.

§

Cmpxchg(Cmpxchg)

An atomic compare-and-exchange operation.

§

AtomicNotify(AtomicNotify)

The atomic.notify instruction to wake up threads.

§

AtomicWait(AtomicWait)

The *.atomic.wait instruction to block threads.

§

AtomicFence(AtomicFence)

The atomic.fence instruction

§

TableGet(TableGet)

table.get

§

TableSet(TableSet)

table.set

§

TableGrow(TableGrow)

table.grow

§

TableSize(TableSize)

table.size

§

TableFill(TableFill)

table.fill

§

RefNull(RefNull)

ref.null $ty

§

RefIsNull(RefIsNull)

ref.is_null

§

RefFunc(RefFunc)

ref.func

§

V128Bitselect(V128Bitselect)

v128.bitselect

§

I8x16Swizzle(I8x16Swizzle)

i8x16.swizzle

§

I8x16Shuffle(I8x16Shuffle)

i8x16.shuffle

§

LoadSimd(LoadSimd)

Various instructions to load a simd vector from memory

§

TableInit(TableInit)

table.init

§

ElemDrop(ElemDrop)

elem.drop

§

TableCopy(TableCopy)

table.copy

Implementations§

source§

impl Instr

source

pub fn block_mut(&mut self) -> Option<&mut Block>

If this instruction is a Block, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_block(&self) -> bool

Is this instruction a Block?

source

pub fn unwrap_block(&self) -> &Block

Get a shared reference to the underlying Block.

Panics if this instruction is not a Block.

source

pub fn unwrap_block_mut(&mut self) -> &mut Block

Get an exclusive reference to the underlying Block.

Panics if this instruction is not a Block.

source

pub fn loop_mut(&mut self) -> Option<&mut Loop>

If this instruction is a Loop, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_loop(&self) -> bool

Is this instruction a Loop?

source

pub fn unwrap_loop(&self) -> &Loop

Get a shared reference to the underlying Loop.

Panics if this instruction is not a Loop.

source

pub fn unwrap_loop_mut(&mut self) -> &mut Loop

Get an exclusive reference to the underlying Loop.

Panics if this instruction is not a Loop.

source

pub fn call_mut(&mut self) -> Option<&mut Call>

If this instruction is a Call, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_call(&self) -> bool

Is this instruction a Call?

source

pub fn unwrap_call(&self) -> &Call

Get a shared reference to the underlying Call.

Panics if this instruction is not a Call.

source

pub fn unwrap_call_mut(&mut self) -> &mut Call

Get an exclusive reference to the underlying Call.

Panics if this instruction is not a Call.

source

pub fn call_indirect_mut(&mut self) -> Option<&mut CallIndirect>

If this instruction is a CallIndirect, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_call_indirect(&self) -> bool

Is this instruction a CallIndirect?

source

pub fn unwrap_call_indirect(&self) -> &CallIndirect

Get a shared reference to the underlying CallIndirect.

Panics if this instruction is not a CallIndirect.

source

pub fn unwrap_call_indirect_mut(&mut self) -> &mut CallIndirect

Get an exclusive reference to the underlying CallIndirect.

Panics if this instruction is not a CallIndirect.

source

pub fn local_get_mut(&mut self) -> Option<&mut LocalGet>

If this instruction is a LocalGet, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_local_get(&self) -> bool

Is this instruction a LocalGet?

source

pub fn unwrap_local_get(&self) -> &LocalGet

Get a shared reference to the underlying LocalGet.

Panics if this instruction is not a LocalGet.

source

pub fn unwrap_local_get_mut(&mut self) -> &mut LocalGet

Get an exclusive reference to the underlying LocalGet.

Panics if this instruction is not a LocalGet.

source

pub fn local_set_mut(&mut self) -> Option<&mut LocalSet>

If this instruction is a LocalSet, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_local_set(&self) -> bool

Is this instruction a LocalSet?

source

pub fn unwrap_local_set(&self) -> &LocalSet

Get a shared reference to the underlying LocalSet.

Panics if this instruction is not a LocalSet.

source

pub fn unwrap_local_set_mut(&mut self) -> &mut LocalSet

Get an exclusive reference to the underlying LocalSet.

Panics if this instruction is not a LocalSet.

source

pub fn local_tee_mut(&mut self) -> Option<&mut LocalTee>

If this instruction is a LocalTee, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_local_tee(&self) -> bool

Is this instruction a LocalTee?

source

pub fn unwrap_local_tee(&self) -> &LocalTee

Get a shared reference to the underlying LocalTee.

Panics if this instruction is not a LocalTee.

source

pub fn unwrap_local_tee_mut(&mut self) -> &mut LocalTee

Get an exclusive reference to the underlying LocalTee.

Panics if this instruction is not a LocalTee.

source

pub fn global_get_mut(&mut self) -> Option<&mut GlobalGet>

If this instruction is a GlobalGet, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_global_get(&self) -> bool

Is this instruction a GlobalGet?

source

pub fn unwrap_global_get(&self) -> &GlobalGet

Get a shared reference to the underlying GlobalGet.

Panics if this instruction is not a GlobalGet.

source

pub fn unwrap_global_get_mut(&mut self) -> &mut GlobalGet

Get an exclusive reference to the underlying GlobalGet.

Panics if this instruction is not a GlobalGet.

source

pub fn global_set_mut(&mut self) -> Option<&mut GlobalSet>

If this instruction is a GlobalSet, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_global_set(&self) -> bool

Is this instruction a GlobalSet?

source

pub fn unwrap_global_set(&self) -> &GlobalSet

Get a shared reference to the underlying GlobalSet.

Panics if this instruction is not a GlobalSet.

source

pub fn unwrap_global_set_mut(&mut self) -> &mut GlobalSet

Get an exclusive reference to the underlying GlobalSet.

Panics if this instruction is not a GlobalSet.

source

pub fn const_mut(&mut self) -> Option<&mut Const>

If this instruction is a Const, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_const(&self) -> bool

Is this instruction a Const?

source

pub fn unwrap_const(&self) -> &Const

Get a shared reference to the underlying Const.

Panics if this instruction is not a Const.

source

pub fn unwrap_const_mut(&mut self) -> &mut Const

Get an exclusive reference to the underlying Const.

Panics if this instruction is not a Const.

source

pub fn binop_mut(&mut self) -> Option<&mut Binop>

If this instruction is a Binop, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_binop(&self) -> bool

Is this instruction a Binop?

source

pub fn unwrap_binop(&self) -> &Binop

Get a shared reference to the underlying Binop.

Panics if this instruction is not a Binop.

source

pub fn unwrap_binop_mut(&mut self) -> &mut Binop

Get an exclusive reference to the underlying Binop.

Panics if this instruction is not a Binop.

source

pub fn unop_mut(&mut self) -> Option<&mut Unop>

If this instruction is a Unop, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_unop(&self) -> bool

Is this instruction a Unop?

source

pub fn unwrap_unop(&self) -> &Unop

Get a shared reference to the underlying Unop.

Panics if this instruction is not a Unop.

source

pub fn unwrap_unop_mut(&mut self) -> &mut Unop

Get an exclusive reference to the underlying Unop.

Panics if this instruction is not a Unop.

source

pub fn select_mut(&mut self) -> Option<&mut Select>

If this instruction is a Select, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_select(&self) -> bool

Is this instruction a Select?

source

pub fn unwrap_select(&self) -> &Select

Get a shared reference to the underlying Select.

Panics if this instruction is not a Select.

source

pub fn unwrap_select_mut(&mut self) -> &mut Select

Get an exclusive reference to the underlying Select.

Panics if this instruction is not a Select.

source

pub fn unreachable_mut(&mut self) -> Option<&mut Unreachable>

If this instruction is a Unreachable, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_unreachable(&self) -> bool

Is this instruction a Unreachable?

source

pub fn unwrap_unreachable(&self) -> &Unreachable

Get a shared reference to the underlying Unreachable.

Panics if this instruction is not a Unreachable.

source

pub fn unwrap_unreachable_mut(&mut self) -> &mut Unreachable

Get an exclusive reference to the underlying Unreachable.

Panics if this instruction is not a Unreachable.

source

pub fn br_mut(&mut self) -> Option<&mut Br>

If this instruction is a Br, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_br(&self) -> bool

Is this instruction a Br?

source

pub fn unwrap_br(&self) -> &Br

Get a shared reference to the underlying Br.

Panics if this instruction is not a Br.

source

pub fn unwrap_br_mut(&mut self) -> &mut Br

Get an exclusive reference to the underlying Br.

Panics if this instruction is not a Br.

source

pub fn br_if_mut(&mut self) -> Option<&mut BrIf>

If this instruction is a BrIf, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_br_if(&self) -> bool

Is this instruction a BrIf?

source

pub fn unwrap_br_if(&self) -> &BrIf

Get a shared reference to the underlying BrIf.

Panics if this instruction is not a BrIf.

source

pub fn unwrap_br_if_mut(&mut self) -> &mut BrIf

Get an exclusive reference to the underlying BrIf.

Panics if this instruction is not a BrIf.

source

pub fn if_else_mut(&mut self) -> Option<&mut IfElse>

If this instruction is a IfElse, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_if_else(&self) -> bool

Is this instruction a IfElse?

source

pub fn unwrap_if_else(&self) -> &IfElse

Get a shared reference to the underlying IfElse.

Panics if this instruction is not a IfElse.

source

pub fn unwrap_if_else_mut(&mut self) -> &mut IfElse

Get an exclusive reference to the underlying IfElse.

Panics if this instruction is not a IfElse.

source

pub fn br_table_mut(&mut self) -> Option<&mut BrTable>

If this instruction is a BrTable, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_br_table(&self) -> bool

Is this instruction a BrTable?

source

pub fn unwrap_br_table(&self) -> &BrTable

Get a shared reference to the underlying BrTable.

Panics if this instruction is not a BrTable.

source

pub fn unwrap_br_table_mut(&mut self) -> &mut BrTable

Get an exclusive reference to the underlying BrTable.

Panics if this instruction is not a BrTable.

source

pub fn drop_mut(&mut self) -> Option<&mut Drop>

If this instruction is a Drop, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_drop(&self) -> bool

Is this instruction a Drop?

source

pub fn unwrap_drop(&self) -> &Drop

Get a shared reference to the underlying Drop.

Panics if this instruction is not a Drop.

source

pub fn unwrap_drop_mut(&mut self) -> &mut Drop

Get an exclusive reference to the underlying Drop.

Panics if this instruction is not a Drop.

source

pub fn return_mut(&mut self) -> Option<&mut Return>

If this instruction is a Return, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_return(&self) -> bool

Is this instruction a Return?

source

pub fn unwrap_return(&self) -> &Return

Get a shared reference to the underlying Return.

Panics if this instruction is not a Return.

source

pub fn unwrap_return_mut(&mut self) -> &mut Return

Get an exclusive reference to the underlying Return.

Panics if this instruction is not a Return.

source

pub fn memory_size_mut(&mut self) -> Option<&mut MemorySize>

If this instruction is a MemorySize, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_memory_size(&self) -> bool

Is this instruction a MemorySize?

source

pub fn unwrap_memory_size(&self) -> &MemorySize

Get a shared reference to the underlying MemorySize.

Panics if this instruction is not a MemorySize.

source

pub fn unwrap_memory_size_mut(&mut self) -> &mut MemorySize

Get an exclusive reference to the underlying MemorySize.

Panics if this instruction is not a MemorySize.

source

pub fn memory_grow_mut(&mut self) -> Option<&mut MemoryGrow>

If this instruction is a MemoryGrow, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_memory_grow(&self) -> bool

Is this instruction a MemoryGrow?

source

pub fn unwrap_memory_grow(&self) -> &MemoryGrow

Get a shared reference to the underlying MemoryGrow.

Panics if this instruction is not a MemoryGrow.

source

pub fn unwrap_memory_grow_mut(&mut self) -> &mut MemoryGrow

Get an exclusive reference to the underlying MemoryGrow.

Panics if this instruction is not a MemoryGrow.

source

pub fn memory_init_mut(&mut self) -> Option<&mut MemoryInit>

If this instruction is a MemoryInit, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_memory_init(&self) -> bool

Is this instruction a MemoryInit?

source

pub fn unwrap_memory_init(&self) -> &MemoryInit

Get a shared reference to the underlying MemoryInit.

Panics if this instruction is not a MemoryInit.

source

pub fn unwrap_memory_init_mut(&mut self) -> &mut MemoryInit

Get an exclusive reference to the underlying MemoryInit.

Panics if this instruction is not a MemoryInit.

source

pub fn data_drop_mut(&mut self) -> Option<&mut DataDrop>

If this instruction is a DataDrop, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_data_drop(&self) -> bool

Is this instruction a DataDrop?

source

pub fn unwrap_data_drop(&self) -> &DataDrop

Get a shared reference to the underlying DataDrop.

Panics if this instruction is not a DataDrop.

source

pub fn unwrap_data_drop_mut(&mut self) -> &mut DataDrop

Get an exclusive reference to the underlying DataDrop.

Panics if this instruction is not a DataDrop.

source

pub fn memory_copy_mut(&mut self) -> Option<&mut MemoryCopy>

If this instruction is a MemoryCopy, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_memory_copy(&self) -> bool

Is this instruction a MemoryCopy?

source

pub fn unwrap_memory_copy(&self) -> &MemoryCopy

Get a shared reference to the underlying MemoryCopy.

Panics if this instruction is not a MemoryCopy.

source

pub fn unwrap_memory_copy_mut(&mut self) -> &mut MemoryCopy

Get an exclusive reference to the underlying MemoryCopy.

Panics if this instruction is not a MemoryCopy.

source

pub fn memory_fill_mut(&mut self) -> Option<&mut MemoryFill>

If this instruction is a MemoryFill, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_memory_fill(&self) -> bool

Is this instruction a MemoryFill?

source

pub fn unwrap_memory_fill(&self) -> &MemoryFill

Get a shared reference to the underlying MemoryFill.

Panics if this instruction is not a MemoryFill.

source

pub fn unwrap_memory_fill_mut(&mut self) -> &mut MemoryFill

Get an exclusive reference to the underlying MemoryFill.

Panics if this instruction is not a MemoryFill.

source

pub fn load_mut(&mut self) -> Option<&mut Load>

If this instruction is a Load, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_load(&self) -> bool

Is this instruction a Load?

source

pub fn unwrap_load(&self) -> &Load

Get a shared reference to the underlying Load.

Panics if this instruction is not a Load.

source

pub fn unwrap_load_mut(&mut self) -> &mut Load

Get an exclusive reference to the underlying Load.

Panics if this instruction is not a Load.

source

pub fn store_mut(&mut self) -> Option<&mut Store>

If this instruction is a Store, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_store(&self) -> bool

Is this instruction a Store?

source

pub fn unwrap_store(&self) -> &Store

Get a shared reference to the underlying Store.

Panics if this instruction is not a Store.

source

pub fn unwrap_store_mut(&mut self) -> &mut Store

Get an exclusive reference to the underlying Store.

Panics if this instruction is not a Store.

source

pub fn atomic_rmw_mut(&mut self) -> Option<&mut AtomicRmw>

If this instruction is a AtomicRmw, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_atomic_rmw(&self) -> bool

Is this instruction a AtomicRmw?

source

pub fn unwrap_atomic_rmw(&self) -> &AtomicRmw

Get a shared reference to the underlying AtomicRmw.

Panics if this instruction is not a AtomicRmw.

source

pub fn unwrap_atomic_rmw_mut(&mut self) -> &mut AtomicRmw

Get an exclusive reference to the underlying AtomicRmw.

Panics if this instruction is not a AtomicRmw.

source

pub fn cmpxchg_mut(&mut self) -> Option<&mut Cmpxchg>

If this instruction is a Cmpxchg, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_cmpxchg(&self) -> bool

Is this instruction a Cmpxchg?

source

pub fn unwrap_cmpxchg(&self) -> &Cmpxchg

Get a shared reference to the underlying Cmpxchg.

Panics if this instruction is not a Cmpxchg.

source

pub fn unwrap_cmpxchg_mut(&mut self) -> &mut Cmpxchg

Get an exclusive reference to the underlying Cmpxchg.

Panics if this instruction is not a Cmpxchg.

source

pub fn atomic_notify_mut(&mut self) -> Option<&mut AtomicNotify>

If this instruction is a AtomicNotify, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_atomic_notify(&self) -> bool

Is this instruction a AtomicNotify?

source

pub fn unwrap_atomic_notify(&self) -> &AtomicNotify

Get a shared reference to the underlying AtomicNotify.

Panics if this instruction is not a AtomicNotify.

source

pub fn unwrap_atomic_notify_mut(&mut self) -> &mut AtomicNotify

Get an exclusive reference to the underlying AtomicNotify.

Panics if this instruction is not a AtomicNotify.

source

pub fn atomic_wait_mut(&mut self) -> Option<&mut AtomicWait>

If this instruction is a AtomicWait, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_atomic_wait(&self) -> bool

Is this instruction a AtomicWait?

source

pub fn unwrap_atomic_wait(&self) -> &AtomicWait

Get a shared reference to the underlying AtomicWait.

Panics if this instruction is not a AtomicWait.

source

pub fn unwrap_atomic_wait_mut(&mut self) -> &mut AtomicWait

Get an exclusive reference to the underlying AtomicWait.

Panics if this instruction is not a AtomicWait.

source

pub fn atomic_fence_mut(&mut self) -> Option<&mut AtomicFence>

If this instruction is a AtomicFence, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_atomic_fence(&self) -> bool

Is this instruction a AtomicFence?

source

pub fn unwrap_atomic_fence(&self) -> &AtomicFence

Get a shared reference to the underlying AtomicFence.

Panics if this instruction is not a AtomicFence.

source

pub fn unwrap_atomic_fence_mut(&mut self) -> &mut AtomicFence

Get an exclusive reference to the underlying AtomicFence.

Panics if this instruction is not a AtomicFence.

source

pub fn table_get_mut(&mut self) -> Option<&mut TableGet>

If this instruction is a TableGet, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_get(&self) -> bool

Is this instruction a TableGet?

source

pub fn unwrap_table_get(&self) -> &TableGet

Get a shared reference to the underlying TableGet.

Panics if this instruction is not a TableGet.

source

pub fn unwrap_table_get_mut(&mut self) -> &mut TableGet

Get an exclusive reference to the underlying TableGet.

Panics if this instruction is not a TableGet.

source

pub fn table_set_mut(&mut self) -> Option<&mut TableSet>

If this instruction is a TableSet, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_set(&self) -> bool

Is this instruction a TableSet?

source

pub fn unwrap_table_set(&self) -> &TableSet

Get a shared reference to the underlying TableSet.

Panics if this instruction is not a TableSet.

source

pub fn unwrap_table_set_mut(&mut self) -> &mut TableSet

Get an exclusive reference to the underlying TableSet.

Panics if this instruction is not a TableSet.

source

pub fn table_grow_mut(&mut self) -> Option<&mut TableGrow>

If this instruction is a TableGrow, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_grow(&self) -> bool

Is this instruction a TableGrow?

source

pub fn unwrap_table_grow(&self) -> &TableGrow

Get a shared reference to the underlying TableGrow.

Panics if this instruction is not a TableGrow.

source

pub fn unwrap_table_grow_mut(&mut self) -> &mut TableGrow

Get an exclusive reference to the underlying TableGrow.

Panics if this instruction is not a TableGrow.

source

pub fn table_size_mut(&mut self) -> Option<&mut TableSize>

If this instruction is a TableSize, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_size(&self) -> bool

Is this instruction a TableSize?

source

pub fn unwrap_table_size(&self) -> &TableSize

Get a shared reference to the underlying TableSize.

Panics if this instruction is not a TableSize.

source

pub fn unwrap_table_size_mut(&mut self) -> &mut TableSize

Get an exclusive reference to the underlying TableSize.

Panics if this instruction is not a TableSize.

source

pub fn table_fill_mut(&mut self) -> Option<&mut TableFill>

If this instruction is a TableFill, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_fill(&self) -> bool

Is this instruction a TableFill?

source

pub fn unwrap_table_fill(&self) -> &TableFill

Get a shared reference to the underlying TableFill.

Panics if this instruction is not a TableFill.

source

pub fn unwrap_table_fill_mut(&mut self) -> &mut TableFill

Get an exclusive reference to the underlying TableFill.

Panics if this instruction is not a TableFill.

source

pub fn ref_null_mut(&mut self) -> Option<&mut RefNull>

If this instruction is a RefNull, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_ref_null(&self) -> bool

Is this instruction a RefNull?

source

pub fn unwrap_ref_null(&self) -> &RefNull

Get a shared reference to the underlying RefNull.

Panics if this instruction is not a RefNull.

source

pub fn unwrap_ref_null_mut(&mut self) -> &mut RefNull

Get an exclusive reference to the underlying RefNull.

Panics if this instruction is not a RefNull.

source

pub fn ref_is_null_mut(&mut self) -> Option<&mut RefIsNull>

If this instruction is a RefIsNull, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_ref_is_null(&self) -> bool

Is this instruction a RefIsNull?

source

pub fn unwrap_ref_is_null(&self) -> &RefIsNull

Get a shared reference to the underlying RefIsNull.

Panics if this instruction is not a RefIsNull.

source

pub fn unwrap_ref_is_null_mut(&mut self) -> &mut RefIsNull

Get an exclusive reference to the underlying RefIsNull.

Panics if this instruction is not a RefIsNull.

source

pub fn ref_func_mut(&mut self) -> Option<&mut RefFunc>

If this instruction is a RefFunc, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_ref_func(&self) -> bool

Is this instruction a RefFunc?

source

pub fn unwrap_ref_func(&self) -> &RefFunc

Get a shared reference to the underlying RefFunc.

Panics if this instruction is not a RefFunc.

source

pub fn unwrap_ref_func_mut(&mut self) -> &mut RefFunc

Get an exclusive reference to the underlying RefFunc.

Panics if this instruction is not a RefFunc.

source

pub fn v128_bitselect_mut(&mut self) -> Option<&mut V128Bitselect>

If this instruction is a V128Bitselect, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_v128_bitselect(&self) -> bool

Is this instruction a V128Bitselect?

source

pub fn unwrap_v128_bitselect(&self) -> &V128Bitselect

Get a shared reference to the underlying V128Bitselect.

Panics if this instruction is not a V128Bitselect.

source

pub fn unwrap_v128_bitselect_mut(&mut self) -> &mut V128Bitselect

Get an exclusive reference to the underlying V128Bitselect.

Panics if this instruction is not a V128Bitselect.

source

pub fn i8x16_swizzle_mut(&mut self) -> Option<&mut I8x16Swizzle>

If this instruction is a I8x16Swizzle, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_i8x16_swizzle(&self) -> bool

Is this instruction a I8x16Swizzle?

source

pub fn unwrap_i8x16_swizzle(&self) -> &I8x16Swizzle

Get a shared reference to the underlying I8x16Swizzle.

Panics if this instruction is not a I8x16Swizzle.

source

pub fn unwrap_i8x16_swizzle_mut(&mut self) -> &mut I8x16Swizzle

Get an exclusive reference to the underlying I8x16Swizzle.

Panics if this instruction is not a I8x16Swizzle.

source

pub fn i8x16_shuffle_mut(&mut self) -> Option<&mut I8x16Shuffle>

If this instruction is a I8x16Shuffle, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_i8x16_shuffle(&self) -> bool

Is this instruction a I8x16Shuffle?

source

pub fn unwrap_i8x16_shuffle(&self) -> &I8x16Shuffle

Get a shared reference to the underlying I8x16Shuffle.

Panics if this instruction is not a I8x16Shuffle.

source

pub fn unwrap_i8x16_shuffle_mut(&mut self) -> &mut I8x16Shuffle

Get an exclusive reference to the underlying I8x16Shuffle.

Panics if this instruction is not a I8x16Shuffle.

source

pub fn load_simd_mut(&mut self) -> Option<&mut LoadSimd>

If this instruction is a LoadSimd, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_load_simd(&self) -> bool

Is this instruction a LoadSimd?

source

pub fn unwrap_load_simd(&self) -> &LoadSimd

Get a shared reference to the underlying LoadSimd.

Panics if this instruction is not a LoadSimd.

source

pub fn unwrap_load_simd_mut(&mut self) -> &mut LoadSimd

Get an exclusive reference to the underlying LoadSimd.

Panics if this instruction is not a LoadSimd.

source

pub fn table_init_mut(&mut self) -> Option<&mut TableInit>

If this instruction is a TableInit, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_init(&self) -> bool

Is this instruction a TableInit?

source

pub fn unwrap_table_init(&self) -> &TableInit

Get a shared reference to the underlying TableInit.

Panics if this instruction is not a TableInit.

source

pub fn unwrap_table_init_mut(&mut self) -> &mut TableInit

Get an exclusive reference to the underlying TableInit.

Panics if this instruction is not a TableInit.

source

pub fn elem_drop_mut(&mut self) -> Option<&mut ElemDrop>

If this instruction is a ElemDrop, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_elem_drop(&self) -> bool

Is this instruction a ElemDrop?

source

pub fn unwrap_elem_drop(&self) -> &ElemDrop

Get a shared reference to the underlying ElemDrop.

Panics if this instruction is not a ElemDrop.

source

pub fn unwrap_elem_drop_mut(&mut self) -> &mut ElemDrop

Get an exclusive reference to the underlying ElemDrop.

Panics if this instruction is not a ElemDrop.

source

pub fn table_copy_mut(&mut self) -> Option<&mut TableCopy>

If this instruction is a TableCopy, get an exclusive reference to it.

Returns None otherwise.

source

pub fn is_table_copy(&self) -> bool

Is this instruction a TableCopy?

source

pub fn unwrap_table_copy(&self) -> &TableCopy

Get a shared reference to the underlying TableCopy.

Panics if this instruction is not a TableCopy.

source

pub fn unwrap_table_copy_mut(&mut self) -> &mut TableCopy

Get an exclusive reference to the underlying TableCopy.

Panics if this instruction is not a TableCopy.

source§

impl Instr

source

pub fn following_instructions_are_unreachable(&self) -> bool

Are any instructions that follow this instruction’s instruction (within the current block) unreachable?

Returns true for unconditional branches (br, return, etc…) and unreachable. Returns false for all other “normal” instructions (i32.add, etc…).

Trait Implementations§

source§

impl Clone for Instr

source§

fn clone(&self) -> Instr

Returns a copy 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 Instr

source§

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

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

impl From<AtomicFence> for Instr

source§

fn from(x: AtomicFence) -> Instr

Converts to this type from the input type.
source§

impl From<AtomicNotify> for Instr

source§

fn from(x: AtomicNotify) -> Instr

Converts to this type from the input type.
source§

impl From<AtomicRmw> for Instr

source§

fn from(x: AtomicRmw) -> Instr

Converts to this type from the input type.
source§

impl From<AtomicWait> for Instr

source§

fn from(x: AtomicWait) -> Instr

Converts to this type from the input type.
source§

impl From<Binop> for Instr

source§

fn from(x: Binop) -> Instr

Converts to this type from the input type.
source§

impl From<Block> for Instr

source§

fn from(x: Block) -> Instr

Converts to this type from the input type.
source§

impl From<Br> for Instr

source§

fn from(x: Br) -> Instr

Converts to this type from the input type.
source§

impl From<BrIf> for Instr

source§

fn from(x: BrIf) -> Instr

Converts to this type from the input type.
source§

impl From<BrTable> for Instr

source§

fn from(x: BrTable) -> Instr

Converts to this type from the input type.
source§

impl From<Call> for Instr

source§

fn from(x: Call) -> Instr

Converts to this type from the input type.
source§

impl From<CallIndirect> for Instr

source§

fn from(x: CallIndirect) -> Instr

Converts to this type from the input type.
source§

impl From<Cmpxchg> for Instr

source§

fn from(x: Cmpxchg) -> Instr

Converts to this type from the input type.
source§

impl From<Const> for Instr

source§

fn from(x: Const) -> Instr

Converts to this type from the input type.
source§

impl From<DataDrop> for Instr

source§

fn from(x: DataDrop) -> Instr

Converts to this type from the input type.
source§

impl From<Drop> for Instr

source§

fn from(x: Drop) -> Instr

Converts to this type from the input type.
source§

impl From<ElemDrop> for Instr

source§

fn from(x: ElemDrop) -> Instr

Converts to this type from the input type.
source§

impl From<GlobalGet> for Instr

source§

fn from(x: GlobalGet) -> Instr

Converts to this type from the input type.
source§

impl From<GlobalSet> for Instr

source§

fn from(x: GlobalSet) -> Instr

Converts to this type from the input type.
source§

impl From<I8x16Shuffle> for Instr

source§

fn from(x: I8x16Shuffle) -> Instr

Converts to this type from the input type.
source§

impl From<I8x16Swizzle> for Instr

source§

fn from(x: I8x16Swizzle) -> Instr

Converts to this type from the input type.
source§

impl From<IfElse> for Instr

source§

fn from(x: IfElse) -> Instr

Converts to this type from the input type.
source§

impl From<Load> for Instr

source§

fn from(x: Load) -> Instr

Converts to this type from the input type.
source§

impl From<LoadSimd> for Instr

source§

fn from(x: LoadSimd) -> Instr

Converts to this type from the input type.
source§

impl From<LocalGet> for Instr

source§

fn from(x: LocalGet) -> Instr

Converts to this type from the input type.
source§

impl From<LocalSet> for Instr

source§

fn from(x: LocalSet) -> Instr

Converts to this type from the input type.
source§

impl From<LocalTee> for Instr

source§

fn from(x: LocalTee) -> Instr

Converts to this type from the input type.
source§

impl From<Loop> for Instr

source§

fn from(x: Loop) -> Instr

Converts to this type from the input type.
source§

impl From<MemoryCopy> for Instr

source§

fn from(x: MemoryCopy) -> Instr

Converts to this type from the input type.
source§

impl From<MemoryFill> for Instr

source§

fn from(x: MemoryFill) -> Instr

Converts to this type from the input type.
source§

impl From<MemoryGrow> for Instr

source§

fn from(x: MemoryGrow) -> Instr

Converts to this type from the input type.
source§

impl From<MemoryInit> for Instr

source§

fn from(x: MemoryInit) -> Instr

Converts to this type from the input type.
source§

impl From<MemorySize> for Instr

source§

fn from(x: MemorySize) -> Instr

Converts to this type from the input type.
source§

impl From<RefFunc> for Instr

source§

fn from(x: RefFunc) -> Instr

Converts to this type from the input type.
source§

impl From<RefIsNull> for Instr

source§

fn from(x: RefIsNull) -> Instr

Converts to this type from the input type.
source§

impl From<RefNull> for Instr

source§

fn from(x: RefNull) -> Instr

Converts to this type from the input type.
source§

impl From<Return> for Instr

source§

fn from(x: Return) -> Instr

Converts to this type from the input type.
source§

impl From<Select> for Instr

source§

fn from(x: Select) -> Instr

Converts to this type from the input type.
source§

impl From<Store> for Instr

source§

fn from(x: Store) -> Instr

Converts to this type from the input type.
source§

impl From<TableCopy> for Instr

source§

fn from(x: TableCopy) -> Instr

Converts to this type from the input type.
source§

impl From<TableFill> for Instr

source§

fn from(x: TableFill) -> Instr

Converts to this type from the input type.
source§

impl From<TableGet> for Instr

source§

fn from(x: TableGet) -> Instr

Converts to this type from the input type.
source§

impl From<TableGrow> for Instr

source§

fn from(x: TableGrow) -> Instr

Converts to this type from the input type.
source§

impl From<TableInit> for Instr

source§

fn from(x: TableInit) -> Instr

Converts to this type from the input type.
source§

impl From<TableSet> for Instr

source§

fn from(x: TableSet) -> Instr

Converts to this type from the input type.
source§

impl From<TableSize> for Instr

source§

fn from(x: TableSize) -> Instr

Converts to this type from the input type.
source§

impl From<Unop> for Instr

source§

fn from(x: Unop) -> Instr

Converts to this type from the input type.
source§

impl From<Unreachable> for Instr

source§

fn from(x: Unreachable) -> Instr

Converts to this type from the input type.
source§

impl From<V128Bitselect> for Instr

source§

fn from(x: V128Bitselect) -> Instr

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Instr

§

impl Send for Instr

§

impl Sync for Instr

§

impl Unpin for Instr

§

impl UnwindSafe for Instr

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.