Enum rant::runtime::Intent [−][src]
pub enum Intent {}Show variants
PrintLast, ReturnLast, ContinueLast, BreakLast, ImportLastAsModule { module_name: String, descope: usize, }, CheckBlock, SetVar { vname: Identifier, access_kind: AccessPathKind, }, DefVar { vname: Identifier, access_kind: AccessPathKind, is_const: bool, }, BuildDynamicGetter { path: Rc<AccessPath>, dynamic_key_count: usize, pending_exprs: Vec<Rc<Sequence>>, override_print: bool, prefer_function: bool, fallback: Option<Rc<Sequence>>, }, GetValue { path: Rc<AccessPath>, dynamic_key_count: usize, override_print: bool, prefer_function: bool, fallback: Option<Rc<Sequence>>, }, BuildDynamicSetter { path: Rc<AccessPath>, write_mode: VarWriteMode, expr_count: usize, pending_exprs: Vec<Rc<Sequence>>, val_source: SetterValueSource, }, SetValue { path: Rc<AccessPath>, write_mode: VarWriteMode, expr_count: usize, }, Invoke { arg_exprs: Rc<Vec<ArgumentExpr>>, arg_eval_count: usize, flag: PrintFlag, is_temporal: bool, }, InvokeComposedStep { steps: Rc<Vec<FunctionCall>>, step_index: usize, state: InvokeComposedStepState, compval: Option<RantValue>, flag: PrintFlag, }, CreateDefaultArgs { context: RantFunctionRef, default_arg_exprs: Vec<(Rc<Sequence>, usize)>, eval_index: usize, }, Call { argc: usize, flag: PrintFlag, override_print: bool, }, CallTemporal { func: RantFunctionRef, args: Rc<Vec<RantValue>>, temporal_state: TemporalSpreadState, flag: PrintFlag, }, BuildList { init: Rc<Vec<Rc<Sequence>>>, index: usize, list: RantList, }, BuildMap { init: Rc<Vec<(MapKeyExpr, Rc<Sequence>)>>, pair_index: usize, map: RantMap, }, BuildWeightedBlock { block: Rc<Block>, weights: Weights, pop_next_weight: bool, }, RuntimeCall { function: Box<dyn FnOnce(&mut VM<'_>) -> RuntimeResult<()>>, interrupt: bool, }, DropStaleUnwinds,
Intents are actions queued on a stack frame that are performed before the frame runs.
“Call” or “Invoke”?
In the context of Rant runtime intents, “calling” and “invoking” have specific meanings:
- “Invoke” means that argument expressions potentially need to be evaluated before the call can proceed;
- “Call” means that all argument values are already known (either in the intent or on the value stack).
Variants
Pop a value off the value stack and print it to the current frame’s output.
Pops a value off the value stack and returns it from the current function.
Pops a value off the value stack and continues to the next repeater iteration with it.
Pops a value off the value stack and breaks from the current repeater with it.
Pops a map off the stack and loads it as a module with the specified name.
Check if the active block is finished and either continue the block or pop the state from the stack
Pop a value off the stack and assign it to an existing variable.
Pop a value off the stack and assign it to a new variable.
Show fields
Fields of DefVar
Pop a block from pending_exprs
and evaluate it. If there are no expressions left, switch intent to GetValue
.
Show fields
Pop dynamic_key_count
values off the stack and use them for expression fields in a getter.
Show fields
Pop a block from pending_exprs
and evaluate it. If there are no expressions left, switch intent to SetValue
.
Show fields
Fields of BuildDynamicSetter
path: Rc<AccessPath>
write_mode: VarWriteMode
expr_count: usize
pending_exprs: Vec<Rc<Sequence>>
val_source: SetterValueSource
Pop expr_count
values off the stack and use them for expression fields in a setter.
Show fields
Fields of SetValue
Evaluate arg_exprs
in order, then pop the argument values off the stack, pop a function off the stack, and pass the arguments to the function.
Show fields
Invoke a single function in a composed function call chain.
Show fields
Fields of InvokeComposedStep
Evaluates each sequence in default_arg_exprs
in order and assigns their results to local constants with their associated Identifier
.
Show fields
Pop argc
args off the stack, then pop a function off the stack and call it with the args.
Call a function for every variant of a temporal argument set and increment the provided temporal state.
Show fields
Fields of CallTemporal
Pop value from stack and add it to a list. If index
is out of range, print the list.
Pop value and optional key from stack and add them to a map. If pair_index
is out of range, print the map.
Evaluate block weights and then run the block
Calls a function that accepts a mutable reference to the current runtime. Optionally interrupts the intent loop to force another tick.
Show fields
Drops all unwind states that are no longer within the call stack.
Auto Trait Implementations
impl !RefUnwindSafe for Intent
impl !RefUnwindSafe for Intent
impl !UnwindSafe for Intent
impl !UnwindSafe for Intent