Module tvix_eval::vm::generators

source ·
Expand description

This module implements generator logic for the VM. Generators are functions used during evaluation which can suspend their execution during their control flow, and request that the VM do something.

This is used to keep the VM’s stack size constant even when evaluating deeply nested recursive data structures.

We implement generators using the genawaiter crate.


  • This is a generator which stores its state on the heap.


  • States that a generator can be in while being driven by the VM.
  • Messages that can be sent from generators to the VM. In most cases, the VM will suspend the generator when receiving a message and enter some other frame to process the request.
  • Responses returned to generators from the VM.


Type Aliases§