about summary refs log tree commit diff
path: root/tvix/eval/src/value/thunk.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/value/thunk.rs')
-rw-r--r--tvix/eval/src/value/thunk.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs
index 8813b0039888..a820e73307ad 100644
--- a/tvix/eval/src/value/thunk.rs
+++ b/tvix/eval/src/value/thunk.rs
@@ -24,6 +24,8 @@ use std::{
     rc::Rc,
 };
 
+use serde::Serialize;
+
 use crate::{
     chunk::Chunk,
     errors::{Error, ErrorKind},
@@ -329,6 +331,15 @@ impl TotalDisplay for Thunk {
     }
 }
 
+impl Serialize for Thunk {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: serde::Serializer,
+    {
+        self.value().serialize(serializer)
+    }
+}
+
 /// A wrapper type for tracking which thunks have already been seen in a
 /// context. This is necessary for cycle detection.
 ///