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
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
impl Instr
sourcepub fn block_mut(&mut self) -> Option<&mut Block>
pub fn block_mut(&mut self) -> Option<&mut Block>
If this instruction is a Block
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_block(&self) -> &Block
pub fn unwrap_block(&self) -> &Block
Get a shared reference to the underlying Block
.
Panics if this instruction is not a Block
.
sourcepub fn unwrap_block_mut(&mut self) -> &mut Block
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
.
sourcepub fn loop_mut(&mut self) -> Option<&mut Loop>
pub fn loop_mut(&mut self) -> Option<&mut Loop>
If this instruction is a Loop
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_loop(&self) -> &Loop
pub fn unwrap_loop(&self) -> &Loop
Get a shared reference to the underlying Loop
.
Panics if this instruction is not a Loop
.
sourcepub fn unwrap_loop_mut(&mut self) -> &mut Loop
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
.
sourcepub fn call_mut(&mut self) -> Option<&mut Call>
pub fn call_mut(&mut self) -> Option<&mut Call>
If this instruction is a Call
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_call(&self) -> &Call
pub fn unwrap_call(&self) -> &Call
Get a shared reference to the underlying Call
.
Panics if this instruction is not a Call
.
sourcepub fn unwrap_call_mut(&mut self) -> &mut Call
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
.
sourcepub fn call_indirect_mut(&mut self) -> Option<&mut CallIndirect>
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.
sourcepub fn is_call_indirect(&self) -> bool
pub fn is_call_indirect(&self) -> bool
Is this instruction a CallIndirect
?
sourcepub fn unwrap_call_indirect(&self) -> &CallIndirect
pub fn unwrap_call_indirect(&self) -> &CallIndirect
Get a shared reference to the underlying CallIndirect
.
Panics if this instruction is not a CallIndirect
.
sourcepub fn unwrap_call_indirect_mut(&mut self) -> &mut CallIndirect
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
.
sourcepub fn local_get_mut(&mut self) -> Option<&mut LocalGet>
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.
sourcepub fn is_local_get(&self) -> bool
pub fn is_local_get(&self) -> bool
Is this instruction a LocalGet
?
sourcepub fn unwrap_local_get(&self) -> &LocalGet
pub fn unwrap_local_get(&self) -> &LocalGet
Get a shared reference to the underlying LocalGet
.
Panics if this instruction is not a LocalGet
.
sourcepub fn unwrap_local_get_mut(&mut self) -> &mut LocalGet
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
.
sourcepub fn local_set_mut(&mut self) -> Option<&mut LocalSet>
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.
sourcepub fn is_local_set(&self) -> bool
pub fn is_local_set(&self) -> bool
Is this instruction a LocalSet
?
sourcepub fn unwrap_local_set(&self) -> &LocalSet
pub fn unwrap_local_set(&self) -> &LocalSet
Get a shared reference to the underlying LocalSet
.
Panics if this instruction is not a LocalSet
.
sourcepub fn unwrap_local_set_mut(&mut self) -> &mut LocalSet
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
.
sourcepub fn local_tee_mut(&mut self) -> Option<&mut LocalTee>
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.
sourcepub fn is_local_tee(&self) -> bool
pub fn is_local_tee(&self) -> bool
Is this instruction a LocalTee
?
sourcepub fn unwrap_local_tee(&self) -> &LocalTee
pub fn unwrap_local_tee(&self) -> &LocalTee
Get a shared reference to the underlying LocalTee
.
Panics if this instruction is not a LocalTee
.
sourcepub fn unwrap_local_tee_mut(&mut self) -> &mut LocalTee
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
.
sourcepub fn global_get_mut(&mut self) -> Option<&mut GlobalGet>
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.
sourcepub fn is_global_get(&self) -> bool
pub fn is_global_get(&self) -> bool
Is this instruction a GlobalGet
?
sourcepub fn unwrap_global_get(&self) -> &GlobalGet
pub fn unwrap_global_get(&self) -> &GlobalGet
Get a shared reference to the underlying GlobalGet
.
Panics if this instruction is not a GlobalGet
.
sourcepub fn unwrap_global_get_mut(&mut self) -> &mut GlobalGet
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
.
sourcepub fn global_set_mut(&mut self) -> Option<&mut GlobalSet>
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.
sourcepub fn is_global_set(&self) -> bool
pub fn is_global_set(&self) -> bool
Is this instruction a GlobalSet
?
sourcepub fn unwrap_global_set(&self) -> &GlobalSet
pub fn unwrap_global_set(&self) -> &GlobalSet
Get a shared reference to the underlying GlobalSet
.
Panics if this instruction is not a GlobalSet
.
sourcepub fn unwrap_global_set_mut(&mut self) -> &mut GlobalSet
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
.
sourcepub fn const_mut(&mut self) -> Option<&mut Const>
pub fn const_mut(&mut self) -> Option<&mut Const>
If this instruction is a Const
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_const(&self) -> &Const
pub fn unwrap_const(&self) -> &Const
Get a shared reference to the underlying Const
.
Panics if this instruction is not a Const
.
sourcepub fn unwrap_const_mut(&mut self) -> &mut Const
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
.
sourcepub fn binop_mut(&mut self) -> Option<&mut Binop>
pub fn binop_mut(&mut self) -> Option<&mut Binop>
If this instruction is a Binop
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_binop(&self) -> &Binop
pub fn unwrap_binop(&self) -> &Binop
Get a shared reference to the underlying Binop
.
Panics if this instruction is not a Binop
.
sourcepub fn unwrap_binop_mut(&mut self) -> &mut Binop
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
.
sourcepub fn unop_mut(&mut self) -> Option<&mut Unop>
pub fn unop_mut(&mut self) -> Option<&mut Unop>
If this instruction is a Unop
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_unop(&self) -> &Unop
pub fn unwrap_unop(&self) -> &Unop
Get a shared reference to the underlying Unop
.
Panics if this instruction is not a Unop
.
sourcepub fn unwrap_unop_mut(&mut self) -> &mut Unop
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
.
sourcepub fn select_mut(&mut self) -> Option<&mut Select>
pub fn select_mut(&mut self) -> Option<&mut Select>
If this instruction is a Select
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_select(&self) -> &Select
pub fn unwrap_select(&self) -> &Select
Get a shared reference to the underlying Select
.
Panics if this instruction is not a Select
.
sourcepub fn unwrap_select_mut(&mut self) -> &mut Select
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
.
sourcepub fn unreachable_mut(&mut self) -> Option<&mut Unreachable>
pub fn unreachable_mut(&mut self) -> Option<&mut Unreachable>
If this instruction is a Unreachable
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn is_unreachable(&self) -> bool
pub fn is_unreachable(&self) -> bool
Is this instruction a Unreachable
?
sourcepub fn unwrap_unreachable(&self) -> &Unreachable
pub fn unwrap_unreachable(&self) -> &Unreachable
Get a shared reference to the underlying Unreachable
.
Panics if this instruction is not a Unreachable
.
sourcepub fn unwrap_unreachable_mut(&mut self) -> &mut Unreachable
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
.
sourcepub fn br_mut(&mut self) -> Option<&mut Br>
pub fn br_mut(&mut self) -> Option<&mut Br>
If this instruction is a Br
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_br(&self) -> &Br
pub fn unwrap_br(&self) -> &Br
Get a shared reference to the underlying Br
.
Panics if this instruction is not a Br
.
sourcepub fn unwrap_br_mut(&mut self) -> &mut Br
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
.
sourcepub fn br_if_mut(&mut self) -> Option<&mut BrIf>
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.
sourcepub fn unwrap_br_if(&self) -> &BrIf
pub fn unwrap_br_if(&self) -> &BrIf
Get a shared reference to the underlying BrIf
.
Panics if this instruction is not a BrIf
.
sourcepub fn unwrap_br_if_mut(&mut self) -> &mut BrIf
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
.
sourcepub fn if_else_mut(&mut self) -> Option<&mut IfElse>
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.
sourcepub fn is_if_else(&self) -> bool
pub fn is_if_else(&self) -> bool
Is this instruction a IfElse
?
sourcepub fn unwrap_if_else(&self) -> &IfElse
pub fn unwrap_if_else(&self) -> &IfElse
Get a shared reference to the underlying IfElse
.
Panics if this instruction is not a IfElse
.
sourcepub fn unwrap_if_else_mut(&mut self) -> &mut IfElse
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
.
sourcepub fn br_table_mut(&mut self) -> Option<&mut BrTable>
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.
sourcepub fn is_br_table(&self) -> bool
pub fn is_br_table(&self) -> bool
Is this instruction a BrTable
?
sourcepub fn unwrap_br_table(&self) -> &BrTable
pub fn unwrap_br_table(&self) -> &BrTable
Get a shared reference to the underlying BrTable
.
Panics if this instruction is not a BrTable
.
sourcepub fn unwrap_br_table_mut(&mut self) -> &mut BrTable
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
.
sourcepub fn drop_mut(&mut self) -> Option<&mut Drop>
pub fn drop_mut(&mut self) -> Option<&mut Drop>
If this instruction is a Drop
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_drop(&self) -> &Drop
pub fn unwrap_drop(&self) -> &Drop
Get a shared reference to the underlying Drop
.
Panics if this instruction is not a Drop
.
sourcepub fn unwrap_drop_mut(&mut self) -> &mut Drop
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
.
sourcepub fn return_mut(&mut self) -> Option<&mut Return>
pub fn return_mut(&mut self) -> Option<&mut Return>
If this instruction is a Return
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_return(&self) -> &Return
pub fn unwrap_return(&self) -> &Return
Get a shared reference to the underlying Return
.
Panics if this instruction is not a Return
.
sourcepub fn unwrap_return_mut(&mut self) -> &mut Return
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
.
sourcepub fn memory_size_mut(&mut self) -> Option<&mut MemorySize>
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.
sourcepub fn is_memory_size(&self) -> bool
pub fn is_memory_size(&self) -> bool
Is this instruction a MemorySize
?
sourcepub fn unwrap_memory_size(&self) -> &MemorySize
pub fn unwrap_memory_size(&self) -> &MemorySize
Get a shared reference to the underlying MemorySize
.
Panics if this instruction is not a MemorySize
.
sourcepub fn unwrap_memory_size_mut(&mut self) -> &mut MemorySize
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
.
sourcepub fn memory_grow_mut(&mut self) -> Option<&mut MemoryGrow>
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.
sourcepub fn is_memory_grow(&self) -> bool
pub fn is_memory_grow(&self) -> bool
Is this instruction a MemoryGrow
?
sourcepub fn unwrap_memory_grow(&self) -> &MemoryGrow
pub fn unwrap_memory_grow(&self) -> &MemoryGrow
Get a shared reference to the underlying MemoryGrow
.
Panics if this instruction is not a MemoryGrow
.
sourcepub fn unwrap_memory_grow_mut(&mut self) -> &mut MemoryGrow
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
.
sourcepub fn memory_init_mut(&mut self) -> Option<&mut MemoryInit>
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.
sourcepub fn is_memory_init(&self) -> bool
pub fn is_memory_init(&self) -> bool
Is this instruction a MemoryInit
?
sourcepub fn unwrap_memory_init(&self) -> &MemoryInit
pub fn unwrap_memory_init(&self) -> &MemoryInit
Get a shared reference to the underlying MemoryInit
.
Panics if this instruction is not a MemoryInit
.
sourcepub fn unwrap_memory_init_mut(&mut self) -> &mut MemoryInit
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
.
sourcepub fn data_drop_mut(&mut self) -> Option<&mut DataDrop>
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.
sourcepub fn is_data_drop(&self) -> bool
pub fn is_data_drop(&self) -> bool
Is this instruction a DataDrop
?
sourcepub fn unwrap_data_drop(&self) -> &DataDrop
pub fn unwrap_data_drop(&self) -> &DataDrop
Get a shared reference to the underlying DataDrop
.
Panics if this instruction is not a DataDrop
.
sourcepub fn unwrap_data_drop_mut(&mut self) -> &mut DataDrop
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
.
sourcepub fn memory_copy_mut(&mut self) -> Option<&mut MemoryCopy>
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.
sourcepub fn is_memory_copy(&self) -> bool
pub fn is_memory_copy(&self) -> bool
Is this instruction a MemoryCopy
?
sourcepub fn unwrap_memory_copy(&self) -> &MemoryCopy
pub fn unwrap_memory_copy(&self) -> &MemoryCopy
Get a shared reference to the underlying MemoryCopy
.
Panics if this instruction is not a MemoryCopy
.
sourcepub fn unwrap_memory_copy_mut(&mut self) -> &mut MemoryCopy
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
.
sourcepub fn memory_fill_mut(&mut self) -> Option<&mut MemoryFill>
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.
sourcepub fn is_memory_fill(&self) -> bool
pub fn is_memory_fill(&self) -> bool
Is this instruction a MemoryFill
?
sourcepub fn unwrap_memory_fill(&self) -> &MemoryFill
pub fn unwrap_memory_fill(&self) -> &MemoryFill
Get a shared reference to the underlying MemoryFill
.
Panics if this instruction is not a MemoryFill
.
sourcepub fn unwrap_memory_fill_mut(&mut self) -> &mut MemoryFill
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
.
sourcepub fn load_mut(&mut self) -> Option<&mut Load>
pub fn load_mut(&mut self) -> Option<&mut Load>
If this instruction is a Load
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_load(&self) -> &Load
pub fn unwrap_load(&self) -> &Load
Get a shared reference to the underlying Load
.
Panics if this instruction is not a Load
.
sourcepub fn unwrap_load_mut(&mut self) -> &mut Load
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
.
sourcepub fn store_mut(&mut self) -> Option<&mut Store>
pub fn store_mut(&mut self) -> Option<&mut Store>
If this instruction is a Store
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn unwrap_store(&self) -> &Store
pub fn unwrap_store(&self) -> &Store
Get a shared reference to the underlying Store
.
Panics if this instruction is not a Store
.
sourcepub fn unwrap_store_mut(&mut self) -> &mut Store
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
.
sourcepub fn atomic_rmw_mut(&mut self) -> Option<&mut AtomicRmw>
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.
sourcepub fn is_atomic_rmw(&self) -> bool
pub fn is_atomic_rmw(&self) -> bool
Is this instruction a AtomicRmw
?
sourcepub fn unwrap_atomic_rmw(&self) -> &AtomicRmw
pub fn unwrap_atomic_rmw(&self) -> &AtomicRmw
Get a shared reference to the underlying AtomicRmw
.
Panics if this instruction is not a AtomicRmw
.
sourcepub fn unwrap_atomic_rmw_mut(&mut self) -> &mut AtomicRmw
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
.
sourcepub fn cmpxchg_mut(&mut self) -> Option<&mut Cmpxchg>
pub fn cmpxchg_mut(&mut self) -> Option<&mut Cmpxchg>
If this instruction is a Cmpxchg
, get an exclusive reference to it.
Returns None
otherwise.
sourcepub fn is_cmpxchg(&self) -> bool
pub fn is_cmpxchg(&self) -> bool
Is this instruction a Cmpxchg
?
sourcepub fn unwrap_cmpxchg(&self) -> &Cmpxchg
pub fn unwrap_cmpxchg(&self) -> &Cmpxchg
Get a shared reference to the underlying Cmpxchg
.
Panics if this instruction is not a Cmpxchg
.
sourcepub fn unwrap_cmpxchg_mut(&mut self) -> &mut Cmpxchg
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
.
sourcepub fn atomic_notify_mut(&mut self) -> Option<&mut AtomicNotify>
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.
sourcepub fn is_atomic_notify(&self) -> bool
pub fn is_atomic_notify(&self) -> bool
Is this instruction a AtomicNotify
?
sourcepub fn unwrap_atomic_notify(&self) -> &AtomicNotify
pub fn unwrap_atomic_notify(&self) -> &AtomicNotify
Get a shared reference to the underlying AtomicNotify
.
Panics if this instruction is not a AtomicNotify
.
sourcepub fn unwrap_atomic_notify_mut(&mut self) -> &mut AtomicNotify
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
.
sourcepub fn atomic_wait_mut(&mut self) -> Option<&mut AtomicWait>
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.
sourcepub fn is_atomic_wait(&self) -> bool
pub fn is_atomic_wait(&self) -> bool
Is this instruction a AtomicWait
?
sourcepub fn unwrap_atomic_wait(&self) -> &AtomicWait
pub fn unwrap_atomic_wait(&self) -> &AtomicWait
Get a shared reference to the underlying AtomicWait
.
Panics if this instruction is not a AtomicWait
.
sourcepub fn unwrap_atomic_wait_mut(&mut self) -> &mut AtomicWait
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
.
sourcepub fn atomic_fence_mut(&mut self) -> Option<&mut AtomicFence>
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.
sourcepub fn is_atomic_fence(&self) -> bool
pub fn is_atomic_fence(&self) -> bool
Is this instruction a AtomicFence
?
sourcepub fn unwrap_atomic_fence(&self) -> &AtomicFence
pub fn unwrap_atomic_fence(&self) -> &AtomicFence
Get a shared reference to the underlying AtomicFence
.
Panics if this instruction is not a AtomicFence
.
sourcepub fn unwrap_atomic_fence_mut(&mut self) -> &mut AtomicFence
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
.
sourcepub fn table_get_mut(&mut self) -> Option<&mut TableGet>
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.
sourcepub fn is_table_get(&self) -> bool
pub fn is_table_get(&self) -> bool
Is this instruction a TableGet
?
sourcepub fn unwrap_table_get(&self) -> &TableGet
pub fn unwrap_table_get(&self) -> &TableGet
Get a shared reference to the underlying TableGet
.
Panics if this instruction is not a TableGet
.
sourcepub fn unwrap_table_get_mut(&mut self) -> &mut TableGet
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
.
sourcepub fn table_set_mut(&mut self) -> Option<&mut TableSet>
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.
sourcepub fn is_table_set(&self) -> bool
pub fn is_table_set(&self) -> bool
Is this instruction a TableSet
?
sourcepub fn unwrap_table_set(&self) -> &TableSet
pub fn unwrap_table_set(&self) -> &TableSet
Get a shared reference to the underlying TableSet
.
Panics if this instruction is not a TableSet
.
sourcepub fn unwrap_table_set_mut(&mut self) -> &mut TableSet
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
.
sourcepub fn table_grow_mut(&mut self) -> Option<&mut TableGrow>
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.
sourcepub fn is_table_grow(&self) -> bool
pub fn is_table_grow(&self) -> bool
Is this instruction a TableGrow
?
sourcepub fn unwrap_table_grow(&self) -> &TableGrow
pub fn unwrap_table_grow(&self) -> &TableGrow
Get a shared reference to the underlying TableGrow
.
Panics if this instruction is not a TableGrow
.
sourcepub fn unwrap_table_grow_mut(&mut self) -> &mut TableGrow
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
.
sourcepub fn table_size_mut(&mut self) -> Option<&mut TableSize>
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.
sourcepub fn is_table_size(&self) -> bool
pub fn is_table_size(&self) -> bool
Is this instruction a TableSize
?
sourcepub fn unwrap_table_size(&self) -> &TableSize
pub fn unwrap_table_size(&self) -> &TableSize
Get a shared reference to the underlying TableSize
.
Panics if this instruction is not a TableSize
.
sourcepub fn unwrap_table_size_mut(&mut self) -> &mut TableSize
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
.
sourcepub fn table_fill_mut(&mut self) -> Option<&mut TableFill>
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.
sourcepub fn is_table_fill(&self) -> bool
pub fn is_table_fill(&self) -> bool
Is this instruction a TableFill
?
sourcepub fn unwrap_table_fill(&self) -> &TableFill
pub fn unwrap_table_fill(&self) -> &TableFill
Get a shared reference to the underlying TableFill
.
Panics if this instruction is not a TableFill
.
sourcepub fn unwrap_table_fill_mut(&mut self) -> &mut TableFill
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
.
sourcepub fn ref_null_mut(&mut self) -> Option<&mut RefNull>
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.
sourcepub fn is_ref_null(&self) -> bool
pub fn is_ref_null(&self) -> bool
Is this instruction a RefNull
?
sourcepub fn unwrap_ref_null(&self) -> &RefNull
pub fn unwrap_ref_null(&self) -> &RefNull
Get a shared reference to the underlying RefNull
.
Panics if this instruction is not a RefNull
.
sourcepub fn unwrap_ref_null_mut(&mut self) -> &mut RefNull
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
.
sourcepub fn ref_is_null_mut(&mut self) -> Option<&mut RefIsNull>
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.
sourcepub fn is_ref_is_null(&self) -> bool
pub fn is_ref_is_null(&self) -> bool
Is this instruction a RefIsNull
?
sourcepub fn unwrap_ref_is_null(&self) -> &RefIsNull
pub fn unwrap_ref_is_null(&self) -> &RefIsNull
Get a shared reference to the underlying RefIsNull
.
Panics if this instruction is not a RefIsNull
.
sourcepub fn unwrap_ref_is_null_mut(&mut self) -> &mut RefIsNull
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
.
sourcepub fn ref_func_mut(&mut self) -> Option<&mut RefFunc>
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.
sourcepub fn is_ref_func(&self) -> bool
pub fn is_ref_func(&self) -> bool
Is this instruction a RefFunc
?
sourcepub fn unwrap_ref_func(&self) -> &RefFunc
pub fn unwrap_ref_func(&self) -> &RefFunc
Get a shared reference to the underlying RefFunc
.
Panics if this instruction is not a RefFunc
.
sourcepub fn unwrap_ref_func_mut(&mut self) -> &mut RefFunc
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
.
sourcepub fn v128_bitselect_mut(&mut self) -> Option<&mut V128Bitselect>
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.
sourcepub fn is_v128_bitselect(&self) -> bool
pub fn is_v128_bitselect(&self) -> bool
Is this instruction a V128Bitselect
?
sourcepub fn unwrap_v128_bitselect(&self) -> &V128Bitselect
pub fn unwrap_v128_bitselect(&self) -> &V128Bitselect
Get a shared reference to the underlying V128Bitselect
.
Panics if this instruction is not a V128Bitselect
.
sourcepub fn unwrap_v128_bitselect_mut(&mut self) -> &mut V128Bitselect
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
.
sourcepub fn i8x16_swizzle_mut(&mut self) -> Option<&mut I8x16Swizzle>
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.
sourcepub fn is_i8x16_swizzle(&self) -> bool
pub fn is_i8x16_swizzle(&self) -> bool
Is this instruction a I8x16Swizzle
?
sourcepub fn unwrap_i8x16_swizzle(&self) -> &I8x16Swizzle
pub fn unwrap_i8x16_swizzle(&self) -> &I8x16Swizzle
Get a shared reference to the underlying I8x16Swizzle
.
Panics if this instruction is not a I8x16Swizzle
.
sourcepub fn unwrap_i8x16_swizzle_mut(&mut self) -> &mut I8x16Swizzle
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
.
sourcepub fn i8x16_shuffle_mut(&mut self) -> Option<&mut I8x16Shuffle>
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.
sourcepub fn is_i8x16_shuffle(&self) -> bool
pub fn is_i8x16_shuffle(&self) -> bool
Is this instruction a I8x16Shuffle
?
sourcepub fn unwrap_i8x16_shuffle(&self) -> &I8x16Shuffle
pub fn unwrap_i8x16_shuffle(&self) -> &I8x16Shuffle
Get a shared reference to the underlying I8x16Shuffle
.
Panics if this instruction is not a I8x16Shuffle
.
sourcepub fn unwrap_i8x16_shuffle_mut(&mut self) -> &mut I8x16Shuffle
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
.
sourcepub fn load_simd_mut(&mut self) -> Option<&mut LoadSimd>
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.
sourcepub fn is_load_simd(&self) -> bool
pub fn is_load_simd(&self) -> bool
Is this instruction a LoadSimd
?
sourcepub fn unwrap_load_simd(&self) -> &LoadSimd
pub fn unwrap_load_simd(&self) -> &LoadSimd
Get a shared reference to the underlying LoadSimd
.
Panics if this instruction is not a LoadSimd
.
sourcepub fn unwrap_load_simd_mut(&mut self) -> &mut LoadSimd
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
.
sourcepub fn table_init_mut(&mut self) -> Option<&mut TableInit>
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.
sourcepub fn is_table_init(&self) -> bool
pub fn is_table_init(&self) -> bool
Is this instruction a TableInit
?
sourcepub fn unwrap_table_init(&self) -> &TableInit
pub fn unwrap_table_init(&self) -> &TableInit
Get a shared reference to the underlying TableInit
.
Panics if this instruction is not a TableInit
.
sourcepub fn unwrap_table_init_mut(&mut self) -> &mut TableInit
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
.
sourcepub fn elem_drop_mut(&mut self) -> Option<&mut ElemDrop>
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.
sourcepub fn is_elem_drop(&self) -> bool
pub fn is_elem_drop(&self) -> bool
Is this instruction a ElemDrop
?
sourcepub fn unwrap_elem_drop(&self) -> &ElemDrop
pub fn unwrap_elem_drop(&self) -> &ElemDrop
Get a shared reference to the underlying ElemDrop
.
Panics if this instruction is not a ElemDrop
.
sourcepub fn unwrap_elem_drop_mut(&mut self) -> &mut ElemDrop
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
.
sourcepub fn table_copy_mut(&mut self) -> Option<&mut TableCopy>
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.
sourcepub fn is_table_copy(&self) -> bool
pub fn is_table_copy(&self) -> bool
Is this instruction a TableCopy
?
sourcepub fn unwrap_table_copy(&self) -> &TableCopy
pub fn unwrap_table_copy(&self) -> &TableCopy
Get a shared reference to the underlying TableCopy
.
Panics if this instruction is not a TableCopy
.
sourcepub fn unwrap_table_copy_mut(&mut self) -> &mut TableCopy
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
impl Instr
sourcepub fn following_instructions_are_unreachable(&self) -> bool
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…).