summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-07-24 23:21:29 +0100
committerMichael Williamson <mike@zwobble.org>2026-07-24 23:21:29 +0100
commit681da8f2c1d85dcda5a676fccaa04415c6adbdcb (patch)
tree14887f269f243952448dafd739a9197317f45661
parent0bbeab46ac9424af89e14e9063f884c9dd8a98ab (diff)
Document (unimplemented) encoding of Shared values
-rw-r--r--docs/transient-0.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/transient-0.md b/docs/transient-0.md
index 90a6c40..67632d6 100644
--- a/docs/transient-0.md
+++ b/docs/transient-0.md
@@ -35,6 +35,16 @@ This describes the current encoding of transient-0.
* `List[T]`: the number of elements in the list encoded as per `Int64`, followed
by each of the elements in the list encoded as per `T`.
+* `Shared[T]`: the first time a value is encountered, encoded as a unique ID as
+ per `Int64` followed by the encoding of the value itself as per `T`.
+
+ Any subsequent times that value is encountered, encoded as the unique ID as
+ per `Int64`.
+
+ Shared values should be assigned incremental IDs starting at zero. That is,
+ the first shared value should have an ID of 0, the second shared value should
+ have an ID of 1, and so on.
+
* A struct is encoded by encoding each of its fields in definition order.
* An enum is encoded by the index of the variant as per `Int32`.