Enum Instruction

Source
pub enum Instruction {
Show 65 variants Import { name: Option<String>, symbols: Vec<String>, level: usize, }, ImportStar, ImportFrom { name: String, }, LoadName { name: String, scope: NameScope, }, StoreName { name: String, scope: NameScope, }, DeleteName { name: String, }, Subscript, StoreSubscript, DeleteSubscript, StoreAttr { name: String, }, DeleteAttr { name: String, }, LoadConst { value: Constant, }, UnaryOperation { op: UnaryOperator, }, BinaryOperation { op: BinaryOperator, inplace: bool, }, LoadAttr { name: String, }, CompareOperation { op: ComparisonOperator, }, Pop, Rotate { amount: usize, }, Duplicate, GetIter, Continue, Break, Jump { target: Label, }, JumpIfTrue { target: Label, }, JumpIfFalse { target: Label, }, JumpIfTrueOrPop { target: Label, }, JumpIfFalseOrPop { target: Label, }, MakeFunction, CallFunction { typ: CallType, }, ForIter { target: Label, }, ReturnValue, YieldValue, YieldFrom, SetupLoop { start: Label, end: Label, }, SetupFinally { handler: Label, }, EnterFinally, EndFinally, SetupExcept { handler: Label, }, SetupWith { end: Label, }, WithCleanupStart, WithCleanupFinish, PopBlock, Raise { argc: usize, }, BuildString { size: usize, }, BuildTuple { size: usize, unpack: bool, }, BuildList { size: usize, unpack: bool, }, BuildSet { size: usize, unpack: bool, }, BuildMap { size: usize, unpack: bool, for_call: bool, }, BuildSlice { size: usize, }, ListAppend { i: usize, }, SetAdd { i: usize, }, MapAdd { i: usize, }, PrintExpr, LoadBuildClass, UnpackSequence { size: usize, }, UnpackEx { before: usize, after: usize, }, FormatValue { conversion: Option<ConversionFlag>, }, PopException, Reverse { amount: usize, }, GetAwaitable, BeforeAsyncWith, SetupAsyncWith { end: Label, }, GetAIter, GetANext, MapAddRev { i: usize, },
}
Expand description

A Single bytecode instruction.

Variants§

§

Import

Fields

§symbols: Vec<String>
§level: usize
§

ImportStar

§

ImportFrom

Fields

§name: String
§

LoadName

Fields

§name: String
§

StoreName

Fields

§name: String
§

DeleteName

Fields

§name: String
§

Subscript

§

StoreSubscript

§

DeleteSubscript

§

StoreAttr

Fields

§name: String
§

DeleteAttr

Fields

§name: String
§

LoadConst

Fields

§value: Constant
§

UnaryOperation

Fields

§

BinaryOperation

Fields

§inplace: bool
§

LoadAttr

Fields

§name: String
§

CompareOperation

§

Pop

§

Rotate

Fields

§amount: usize
§

Duplicate

§

GetIter

§

Continue

§

Break

§

Jump

Fields

§target: Label
§

JumpIfTrue

Pop the top of the stack, and jump if this value is true.

Fields

§target: Label
§

JumpIfFalse

Pop the top of the stack, and jump if this value is false.

Fields

§target: Label
§

JumpIfTrueOrPop

Peek at the top of the stack, and jump if this value is true. Otherwise, pop top of stack.

Fields

§target: Label
§

JumpIfFalseOrPop

Peek at the top of the stack, and jump if this value is false. Otherwise, pop top of stack.

Fields

§target: Label
§

MakeFunction

§

CallFunction

Fields

§

ForIter

Fields

§target: Label
§

ReturnValue

§

YieldValue

§

YieldFrom

§

SetupLoop

Fields

§start: Label
§end: Label
§

SetupFinally

Setup a finally handler, which will be called whenever one of this events occurs:

  • the block is popped
  • the function returns
  • an exception is returned

Fields

§handler: Label
§

EnterFinally

Enter a finally block, without returning, excepting, just because we are there.

§

EndFinally

Marker bytecode for the end of a finally sequence. When this bytecode is executed, the eval loop does one of those things:

  • Continue at a certain bytecode position
  • Propagate the exception
  • Return from a function
  • Do nothing at all, just continue
§

SetupExcept

Fields

§handler: Label
§

SetupWith

Fields

§end: Label
§

WithCleanupStart

§

WithCleanupFinish

§

PopBlock

§

Raise

Fields

§argc: usize
§

BuildString

Fields

§size: usize
§

BuildTuple

Fields

§size: usize
§unpack: bool
§

BuildList

Fields

§size: usize
§unpack: bool
§

BuildSet

Fields

§size: usize
§unpack: bool
§

BuildMap

Fields

§size: usize
§unpack: bool
§for_call: bool
§

BuildSlice

Fields

§size: usize
§

ListAppend

Fields

§

SetAdd

Fields

§

MapAdd

Fields

§

PrintExpr

§

LoadBuildClass

§

UnpackSequence

Fields

§size: usize
§

UnpackEx

Fields

§before: usize
§after: usize
§

FormatValue

Fields

§

PopException

§

Reverse

Fields

§amount: usize
§

GetAwaitable

§

BeforeAsyncWith

§

SetupAsyncWith

Fields

§end: Label
§

GetAIter

§

GetANext

§

MapAddRev

Reverse order evaluation in MapAdd required to support named expressions of Python 3.8 in dict comprehension today (including Py3.9) only required in dict comprehension.

Fields

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Instruction

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 Instruction

Source§

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

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

impl<'de> Deserialize<'de> for Instruction

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 Instruction

Source§

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

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 Instruction

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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>,