Skip to main content

Op

Enum Op 

Source
pub enum Op {
Show 62 variants PushConst(u32), Pop, Dup, LoadLocal(u16), StoreLocal(u16), MakeRecord { field_name_indices: Vec<u32>, }, MakeTuple(u16), MakeList(u32), MakeVariant { name_idx: u32, arity: u16, }, GetField(u32), GetElem(u16), TestVariant(u32), GetVariant(u32), GetVariantArg(u16), GetListLen, GetListElem(u32), ListAppend, GetListElemDyn, Jump(i32), JumpIf(i32), JumpIfNot(i32), Call { fn_id: u32, arity: u16, node_id_idx: u32, }, TailCall { fn_id: u32, arity: u16, node_id_idx: u32, }, MakeClosure { fn_id: u32, capture_count: u16, }, CallClosure { arity: u16, node_id_idx: u32, }, EffectCall { kind_idx: u32, op_idx: u32, arity: u16, node_id_idx: u32, }, Return, Panic(u32), IntAdd, IntSub, IntMul, IntDiv, IntMod, IntNeg, IntEq, IntLt, IntLe, FloatAdd, FloatSub, FloatMul, FloatDiv, FloatNeg, FloatEq, FloatLt, FloatLe, NumAdd, NumSub, NumMul, NumDiv, NumMod, NumNeg, NumEq, NumLt, NumLe, BoolAnd, BoolOr, BoolNot, StrConcat, StrLen, StrEq, BytesLen, BytesEq,
}

Variants§

§

PushConst(u32)

§

Pop

§

Dup

§

LoadLocal(u16)

§

StoreLocal(u16)

§

MakeRecord

Builds a record from count (name_const_idx, value) pairs on the stack. Stack: [name_idx_n, val_n, …, name_idx_1, val_1] but encoded as alternating <name_idx_const_u32> <value popped from stack> — for simplicity we instead push count values and count field name constants in the same op as a Vec<u32> of name indices.

Fields

§field_name_indices: Vec<u32>
§

MakeTuple(u16)

§

MakeList(u32)

§

MakeVariant

Fields

§name_idx: u32
§arity: u16
§

GetField(u32)

§

GetElem(u16)

§

TestVariant(u32)

§

GetVariant(u32)

§

GetVariantArg(u16)

§

GetListLen

§

GetListElem(u32)

§

ListAppend

Pop [list, value]; push list with value appended.

§

GetListElemDyn

Pop list; push it indexed by the integer on top. Stack: [list, idx] → [list[idx]]. (Like GetListElem(u32) but the index is dynamic.)

§

Jump(i32)

§

JumpIf(i32)

§

JumpIfNot(i32)

§

Call

Fields

§fn_id: u32
§arity: u16
§node_id_idx: u32
§

TailCall

Fields

§fn_id: u32
§arity: u16
§node_id_idx: u32
§

MakeClosure

Build a Value::Closure: pop capture_count values (in order) and pair them with fn_id.

Fields

§fn_id: u32
§capture_count: u16
§

CallClosure

Call a closure: pop arity args + 1 closure (top of stack), invoke.

Fields

§arity: u16
§node_id_idx: u32
§

EffectCall

EFFECT_CALL <effect_kind_const_idx> <op_name_const_idx> <arity>. Pops arity args, dispatches to a host effect handler, pushes result. node_id_idx points to a Const::NodeId for trace keying.

Fields

§kind_idx: u32
§op_idx: u32
§arity: u16
§node_id_idx: u32
§

Return

§

Panic(u32)

§

IntAdd

§

IntSub

§

IntMul

§

IntDiv

§

IntMod

§

IntNeg

§

IntEq

§

IntLt

§

IntLe

§

FloatAdd

§

FloatSub

§

FloatMul

§

FloatDiv

§

FloatNeg

§

FloatEq

§

FloatLt

§

FloatLe

§

NumAdd

§

NumSub

§

NumMul

§

NumDiv

§

NumMod

§

NumNeg

§

NumEq

§

NumLt

§

NumLe

§

BoolAnd

§

BoolOr

§

BoolNot

§

StrConcat

§

StrLen

§

StrEq

§

BytesLen

§

BytesEq

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

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

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

impl<'de> Deserialize<'de> for Op

Source§

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

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

impl PartialEq for Op

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Op

Source§

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

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

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> 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> Same for T

Source§

type Output = T

Should always be Self
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,