pub enum Opcode {
Show 96 variants
PushInt(i32),
PushFloat(f32),
PushBool(bool),
PushString(u16),
PushList(u16),
PushDivertTarget(DefinitionId),
PushNull,
Pop,
Duplicate,
Add,
Subtract,
Multiply,
Divide,
Modulo,
Negate,
Equal,
NotEqual,
Greater,
GreaterOrEqual,
Less,
LessOrEqual,
Not,
And,
Or,
GetGlobal(DefinitionId),
SetGlobal(DefinitionId),
DeclareTemp(u16),
GetTemp(u16),
SetTemp(u16),
GetTempRaw(u16),
PushVarPointer(DefinitionId),
PushTempPointer(u16),
Jump(i32),
JumpIfFalse(i32),
Goto(DefinitionId),
GotoIf(DefinitionId),
GotoVariable,
EnterContainer(DefinitionId),
ExitContainer,
Call(DefinitionId),
Return,
TunnelCall(DefinitionId),
TunnelReturn,
TunnelCallVariable,
CallVariable,
ThreadCall(DefinitionId),
ThreadStart,
ThreadDone,
EmitLine(u16, u8),
EmitValue,
EmitNewline,
Spring,
Glue,
BeginTag,
EndTag,
EvalLine(u16, u8),
BeginFragment,
EndFragment,
BeginChoice(ChoiceFlags, DefinitionId),
EndChoice,
Sequence(SequenceKind, u8),
SequenceBranch(i32),
VisitCount,
CurrentVisitCount,
TurnsSince,
TurnIndex,
ChoiceCount,
Random,
SeedRandom,
CastToInt,
CastToFloat,
Floor,
Ceiling,
Pow,
Min,
Max,
CallExternal(DefinitionId, u8),
ListContains,
ListNotContains,
ListIntersect,
ListAll,
ListInvert,
ListCount,
ListMin,
ListMax,
ListValue,
ListRange,
ListFromInt,
ListRandom,
Done,
Yield,
End,
Nop,
BeginStringEval,
EndStringEval,
SourceLocation(u32, u32),
}Expand description
A single VM instruction with its operands.
Variants§
PushInt(i32)
PushFloat(f32)
PushBool(bool)
PushString(u16)
PushList(u16)
PushDivertTarget(DefinitionId)
PushNull
Pop
Duplicate
Add
Subtract
Multiply
Divide
Modulo
Negate
Equal
NotEqual
Greater
GreaterOrEqual
Less
LessOrEqual
Not
And
Or
GetGlobal(DefinitionId)
SetGlobal(DefinitionId)
DeclareTemp(u16)
GetTemp(u16)
SetTemp(u16)
GetTempRaw(u16)
Get a temp’s raw value without auto-dereference (for passing a ref onward).
PushVarPointer(DefinitionId)
Push a pointer to a global variable onto the eval stack.
PushTempPointer(u16)
Push a pointer to a temp variable onto the eval stack.
Jump(i32)
JumpIfFalse(i32)
Goto(DefinitionId)
GotoIf(DefinitionId)
GotoVariable
EnterContainer(DefinitionId)
ExitContainer
Call(DefinitionId)
Return
TunnelCall(DefinitionId)
TunnelReturn
TunnelCallVariable
CallVariable
ThreadCall(DefinitionId)
ThreadStart
ThreadDone
EmitLine(u16, u8)
EmitValue
EmitNewline
Spring
Word break — renders as a single space between content parts.
Glue
BeginTag
EndTag
EvalLine(u16, u8)
BeginFragment
Begin capturing output into a fragment (structural preservation).
EndFragment
End fragment capture — store parts and push Value::FragmentRef.
BeginChoice(ChoiceFlags, DefinitionId)
EndChoice
Sequence(SequenceKind, u8)
SequenceBranch(i32)
VisitCount
Pop a DivertTarget from the stack, push its visit count.
CurrentVisitCount
Push the visit count of the current container (no stack input).
TurnsSince
TurnIndex
ChoiceCount
Random
SeedRandom
CastToInt
CastToFloat
Floor
Ceiling
Pow
Min
Max
CallExternal(DefinitionId, u8)
ListContains
ListNotContains
ListIntersect
ListAll
ListInvert
ListCount
ListMin
ListMax
ListValue
ListRange
ListFromInt
ListRandom
Done
Yield
Pause for choice presentation. Like Done but does NOT set
did_safe_exit — if no choices are pending, the story ran
out of content rather than reaching an explicit -> DONE.
End
Nop
BeginStringEval
EndStringEval
SourceLocation(u32, u32)
Implementations§
Trait Implementations§
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnsafeUnpin for Opcode
impl UnwindSafe for Opcode
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