summaryrefslogtreecommitdiff
path: root/docs/transient-0.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/transient-0.md')
-rw-r--r--docs/transient-0.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/transient-0.md b/docs/transient-0.md
index 410bb62..90a6c40 100644
--- a/docs/transient-0.md
+++ b/docs/transient-0.md
@@ -21,15 +21,23 @@ This describes the current encoding of transient-0.
* `Bool`: a one-byte integer where true and false are represented by
1 and 0 respectively.
+
* `Int32`: a four-byte little endian integer.
+
* `Int64`: an eight-byte little endian integer.
+
* `String`: the length of the UTF-8 encoding of the string written as per
`Int64`, followed by that UTF-8 encoding.
+
* `Option[T]`: if `none`, encoded as per `false`, otherwise encoded as per
`true` followed by the encoding of the value as per `T`.
+
* `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`.
+
* 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`.
+
* A sum is encoded by the index of the variant as per `Int32` followed by the
encoding as per the type of the variant.