Documentation
¶
Overview ¶
Package persistenttree provides an immutable ordered map with structural sharing: an update returns a new tree sharing every untouched subtree with the old one, so both remain valid and comparable. Delta hashing over shared subtrees lets a caller find what changed between two versions without walking either in full.
Index ¶
- type Change
- type Entry
- type Node
- func (n *Node[V]) Get(key []byte) (V, bool)
- func (n *Node[V]) Maximum() (key string, value V, ok bool)
- func (n *Node[V]) Minimum() (key string, value V, ok bool)
- func (n *Node[V]) Walk(visit func(string, V) bool) bool
- func (n *Node[V]) WalkChanges(previous *Node[V], equal func(V, V) bool, visit func(Change[V]) bool) bool
- func (n *Node[V]) WalkPrefix(prefix []byte, visit func(string, V) bool) bool
- type Tree
- type Txn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node[V any] struct { // contains filtered or unexported fields }
Node is an opaque immutable snapshot used for identity and reads.
type Tree ¶
type Tree[V any] struct { // contains filtered or unexported fields }
Tree is an immutable ordered map.
func NewFromSorted ¶
NewFromSorted builds a frozen tree from strictly ordered entries.
type Txn ¶
type Txn[V any] struct { // contains filtered or unexported fields }
Txn accumulates persistent updates without mutating its source tree.
Click to show internal directories.
Click to hide internal directories.