An Elixir implementation of AT Protocol-flavoured Merkle Search Trees (MST)
1defmodule MST.Node.Entry do
2 @moduledoc """
3 A single entry within an `MST.Node`.
4
5 Stores a compressed key (`prefix_len` bytes shared with the previous entry's
6 full key, plus `key_suffix`), the CID of the value record (`value`), and an
7 optional CID pointing to a right subtree (`right`).
8 """
9
10 use TypedStruct
11
12 alias DASL.CID
13
14 typedstruct enforce: true do
15 field :prefix_len, non_neg_integer()
16 field :key_suffix, binary()
17 field :value, CID.t()
18 field :right, CID.t() | nil
19 end
20end