about summary refs log tree commit diff
path: root/tvix/eval/src/vm/mod.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-03-13T21·44+0300
committertazjin <tazjin@tvl.su>2023-03-14T09·22+0000
commitd4567053523cb3fc0a2b54245c9b25cdc52365aa (patch)
tree615814946310267a2a16164a4672362e13e4968b /tvix/eval/src/vm/mod.rs
parent1e80b9ea8b9a28588a90a0835988bb3b3067e7d6 (diff)
chore(tvix): Generator{Request|Response} -> VM{Request|Response} r/5992
We settled on this being the most reasonable name for this construct.

Change-Id: Ic31c45461a842f22aa05f4446123fe3a61dfdbc0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8291
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/eval/src/vm/mod.rs')
-rw-r--r--tvix/eval/src/vm/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 610246abe0c8..fbecab959054 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -37,7 +37,7 @@ use crate::{
 
 use generators::{call_functor, Generator, GeneratorState};
 
-use self::generators::{GeneratorRequest, GeneratorResponse};
+use self::generators::{VMRequest, VMResponse};
 
 /// Internal helper trait for ergonomically converting from a `Result<T,
 /// ErrorKind>` to a `Result<T, Error>` using the current span of a call frame.
@@ -300,7 +300,7 @@ impl<'o> VM<'o> {
 
                     let initial_msg = if catchable_error_occurred {
                         catchable_error_occurred = false;
-                        Some(GeneratorResponse::ForceError)
+                        Some(VMResponse::ForceError)
                     } else {
                         None
                     };
@@ -1009,8 +1009,8 @@ async fn resolve_with(
 ) -> Result<Value, ErrorKind> {
     /// Fetch and force a value on the with-stack from the VM.
     async fn fetch_forced_with(co: &GenCo, idx: usize) -> Value {
-        match co.yield_(GeneratorRequest::WithValue(idx)).await {
-            GeneratorResponse::Value(value) => value,
+        match co.yield_(VMRequest::WithValue(idx)).await {
+            VMResponse::Value(value) => value,
             msg => panic!(
                 "Tvix bug: VM responded with incorrect generator message: {}",
                 msg
@@ -1020,8 +1020,8 @@ async fn resolve_with(
 
     /// Fetch and force a value on the *captured* with-stack from the VM.
     async fn fetch_captured_with(co: &GenCo, idx: usize) -> Value {
-        match co.yield_(GeneratorRequest::CapturedWithValue(idx)).await {
-            GeneratorResponse::Value(value) => value,
+        match co.yield_(VMRequest::CapturedWithValue(idx)).await {
+            VMResponse::Value(value) => value,
             msg => panic!(
                 "Tvix bug: VM responded with incorrect generator message: {}",
                 msg