#[repr(u8)]pub enum Op {
Show 68 variants
LoadConst = 0,
LoadNone = 1,
LoadTrue = 2,
LoadFalse = 3,
Move = 4,
GetLocal = 5,
SetLocal = 6,
GetGlobal = 7,
SetGlobal = 8,
GetUpvalue = 9,
SetUpvalue = 10,
Add = 11,
Sub = 12,
Mul = 13,
Div = 14,
Mod = 15,
Pow = 16,
Neg = 17,
Eq = 18,
Neq = 19,
Lt = 20,
Gt = 21,
Lte = 22,
Gte = 23,
And = 24,
Or = 25,
Not = 26,
Concat = 27,
Jump = 28,
JumpIfFalse = 29,
JumpIfTrue = 30,
Call = 31,
Return = 32,
Closure = 33,
NewList = 34,
GetIndex = 35,
SetIndex = 36,
NewMap = 37,
TablePipe = 38,
CallBuiltin = 39,
ForIter = 40,
ForPrep = 41,
TestMatch = 42,
NullCoalesce = 43,
GetMember = 44,
Interpolate = 45,
Train = 46,
PipelineExec = 47,
StreamExec = 48,
ConnectorDecl = 49,
NewStruct = 50,
SetMember = 51,
NewEnum = 52,
MatchEnum = 53,
MethodCall = 54,
Throw = 55,
TryBegin = 56,
TryEnd = 57,
Import = 58,
Await = 59,
Yield = 60,
TryPropagate = 61,
ExtractField = 62,
ExtractNamedField = 63,
LoadMoved = 64,
MakeRef = 65,
ParallelFor = 66,
AgentExec = 67,
}Expand description
Bytecode operations for the TL virtual machine.
Variants§
LoadConst = 0
Load constant pool[Bx] into register A
LoadNone = 1
Load None into register A
LoadTrue = 2
Load true into register A
LoadFalse = 3
Load false into register A
Move = 4
Copy register B into register A
GetLocal = 5
Load local slot B into register A
SetLocal = 6
Store register A into local slot B
GetGlobal = 7
Load global named by constant Bx into register A
SetGlobal = 8
Store register A into global named by constant Bx
GetUpvalue = 9
Load upvalue index B into register A
SetUpvalue = 10
Store register A into upvalue index B
Add = 11
A = B + C
Sub = 12
A = B - C
Mul = 13
A = B * C
Div = 14
A = B / C
Mod = 15
A = B % C
Pow = 16
A = B ** C
Neg = 17
A = -B
Eq = 18
A = (B == C)
Neq = 19
A = (B != C)
Lt = 20
A = (B < C)
Gt = 21
A = (B > C)
Lte = 22
A = (B <= C)
Gte = 23
A = (B >= C)
And = 24
A = B and C
Or = 25
A = B or C
Not = 26
A = not B
Concat = 27
A = concat(B, C)
Jump = 28
Jump by signed offset Bx (as i16)
JumpIfFalse = 29
If register A is falsy, jump by signed offset Bx
JumpIfTrue = 30
If register A is truthy, jump by signed offset Bx
Call = 31
Call: A = function register, B = first arg register, C = arg count Result goes into register A
Return = 32
Return register A
Closure = 33
Create closure from prototype at constant Bx, store in A Followed by upvalue descriptors
NewList = 34
Create list: A = dest, B = start register, C = count
GetIndex = 35
A = B[C]
SetIndex = 36
B[C] = A
NewMap = 37
Create map: A = dest, B = start register (alternating key/value), C = pair count
TablePipe = 38
TablePipe: A = table reg, B = op constant index, C = args start The VM handles this specially for DataFusion table ops
CallBuiltin = 39
CallBuiltin: A = dest, B = builtin id, C = first arg reg Next instruction word: arg count in A field
ForIter = 40
ForIter: A = iterator reg, B = value dest, jump offset in next Bx if done
ForPrep = 41
ForPrep: A = dest for iterator, B = list register
TestMatch = 42
TestMatch: A = subject reg, B = pattern reg, C = dest bool reg
NullCoalesce = 43
NullCoalesce: if A is None, A = B
GetMember = 44
GetMember: A = dest, B = object reg, C = field name constant
Interpolate = 45
Interpolate: A = dest, B = template constant, C = values start reg Next instruction word: value count in A field
Train = 46
Train: A = dest for model, B = algorithm constant, C = config constant
PipelineExec = 47
PipelineExec: A = dest for result, B = pipeline blocks constant, C = config constant
StreamExec = 48
StreamExec: A = dest, B = stream def constant, C = source register
ConnectorDecl = 49
ConnectorDecl: A = dest, B = connector type constant, C = config constant
NewStruct = 50
NewStruct: A = dest, B = type name constant, C = field count Followed by field name/value register pairs
SetMember = 51
SetMember: A = object reg, B = field name constant, C = value reg
NewEnum = 52
NewEnum: A = dest, B = type+variant name constant, C = args start reg Next instruction: arg count in A field
MatchEnum = 53
MatchEnum: A = subject reg, B = variant name constant, C = dest bool reg
MethodCall = 54
MethodCall: A = dest/func reg, B = object reg, C = method name constant Next instruction: args_start in A, arg_count in B
Throw = 55
Throw: A = value register to throw
TryBegin = 56
TryBegin: A = catch handler offset (as Bx signed)
TryEnd = 57
TryEnd: pops the try handler
Import = 58
Import: A = dest, Bx = path constant
Await = 59
Await: A = dest, B = task register (passthrough if not a task)
Yield = 60
Yield: A = value register to yield (suspends generator)
TryPropagate = 61
TryPropagate: A = dest, B = source register If source is Err(…) → early return from current function If source is Ok(v) → A = v (unwrap) If source is None → early return None Otherwise → passthrough
ExtractField = 62
ExtractField: A = dest, B = source reg, C = field index Extracts field[C] from an enum instance or list into dest. If C has high bit set (C | 0x80), extracts rest (sublist from index C & 0x7F).
ExtractNamedField = 63
ExtractNamedField: A = dest, B = source reg, C = field name constant index Extracts a named field from a struct into dest.
LoadMoved = 64
LoadMoved: A = Moved tombstone
MakeRef = 65
MakeRef: A = Ref(B) — wrap value in read-only reference
ParallelFor = 66
ParallelFor: A = list reg, B = body prototype constant, C = unused
AgentExec = 67
AgentExec: A = dest, B = name constant, C = config constant
Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);