pub enum Op {
Show 62 variants
ConstUnit,
ConstBool,
ConstInt,
FuncRef,
ConstTag,
ConstFloat,
Str,
Copy,
Clear,
Neg(Num),
Arith(Num, ArithOp),
Cmp(Compare, CmpOp),
ArithImm(ArithOp),
CmpImm(CmpOp),
Not,
Convert(Convert),
Jump,
BranchFalse,
Switch,
Return,
Call,
CallClosure,
CallHost,
CallResource,
CallBuiltin,
AllocFixed,
AllocImm,
AllocSlot,
LoadField,
StoreField,
LoadElem,
StoreElem,
ByteAt,
AllocBytes,
WriteByte,
CopyBytes,
FinishString,
AllocBuffer,
AppendByte,
AppendBytes,
FinishBuffer,
Len,
LayoutOf,
AddrOfSlot,
AddrOfField,
AddrOfElem,
AddrOfPart,
Load,
Store,
Box,
Unbox,
ScopeEnter,
ScopeLeave,
ScopeCancel,
Spawn,
Await,
Cancel,
Settled,
SharedLock,
SharedUnlock,
Trap,
AssertFailed,
}Expand description
One concrete operation.
The parameterised variants are the cross products ADR 0041 generates: an
Op::Arith(Num::Int, ArithOp::Add) is add.int, and there is no second
name for it.
Variants§
ConstUnit
ConstBool
ConstInt
FuncRef
ConstTag
ConstFloat
Str
Copy
Clear
Neg(Num)
Arith(Num, ArithOp)
Cmp(Compare, CmpOp)
ArithImm(ArithOp)
CmpImm(CmpOp)
Not
Convert(Convert)
Jump
BranchFalse
Switch
Return
Call
CallClosure
CallHost
CallResource
CallBuiltin
AllocFixed
AllocImm
AllocSlot
LoadField
StoreField
LoadElem
StoreElem
ByteAt
AllocBytes
WriteByte
CopyBytes
FinishString
AllocBuffer
AppendByte
AppendBytes
FinishBuffer
Len
LayoutOf
AddrOfSlot
AddrOfField
AddrOfElem
AddrOfPart
Load
Store
Box
Unbox
ScopeEnter
ScopeLeave
ScopeCancel
Spawn
Await
Cancel
Settled
Trap
AssertFailed
Implementations§
Source§impl Op
impl Op
Sourcepub fn all() -> Vec<Op>
pub fn all() -> Vec<Op>
Every opcode, in the order that gives them their numbers.
This is the generated table ADR 0041 asks for. A family with members contributes its cross product, in the order of the arrays above.
Sourcepub const fn number(self) -> u8
pub const fn number(self) -> u8
The byte this opcode is written as.
const, so that an opcode is usable as a match pattern. That is
what lets the runtime’s encoded dispatch name add.int.imm by
writing Op::ArithImm(ArithOp::Add).number() instead of a literal,
and it is why ADR 0041’s “opcode numbers are positions in a
generated table and move when the table does” costs nothing outside
this file.
Trait Implementations§
impl Copy for Op
impl Eq for Op
impl StructuralPartialEq for Op
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnsafeUnpin for Op
impl UnwindSafe for Op
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.