pub struct TreeNode {
pub index: MediaRef,
pub trigram: Option<MediaRef>,
pub bloom: String,
pub files: u64,
pub bytes: u64,
}Expand description
A directory node of a tree mint (design doc: tree-scale). When a token names
a directory minted --tree, it carries one of these instead of a flat list of
per-file child tokens: the directory’s index (files pinned by hash, subdirs
addressed by their own subtree token), the trigram index over its files,
and a Bloom summary of every trigram beneath it, inlined so a search can
prune the subtree from the manifest alone. Files pin their bytes eagerly (so a
deleted file still reads — C-1) and are addressed by name within their node
(read --file); a file is not itself a token, so a folder of thousands mints
as a handful of nodes, not thousands of tokens.
The bloom is the lowercase-hex wire form of a fixed-size filter (parsed into
the typed structure by the consumer, waggle-tree::Bloom); keeping it a string
here preserves this crate’s dependency-free leaf position. Immutable core —
signed; absent for non-tree mints, so their manifests keep their exact bytes.
Fields§
§index: MediaRefContent-addressed directory index for THIS node (its direct entries).
trigram: Option<MediaRef>Content-addressed trigram index over this node’s own files; absent when the node has no indexable text of its own (e.g. only subdirectories).
bloom: StringHex Bloom summary of every trigram in this subtree — inlined for prune.
files: u64Files anywhere beneath this node (recursive).
bytes: u64Bytes anywhere beneath this node (recursive).