pub struct LsNode {
pub id: usize,
pub name: String,
pub path: String,
pub pack_type: String,
pub synthetic: bool,
pub unsynced: bool,
pub error: Option<LsNodeError>,
pub children: Vec<LsNode>,
}Expand description
One node in the structured ls tree.
id is a stable in-walk counter so JSON consumers can address a
specific node without path-string parsing. synthetic = true marks
plain-git children whose pack manifest was synthesised in-memory by
the walker (no .grex/pack.yaml on disk); type is always
"scripted" for synthetic nodes per the v1.1.1 design.
The flags synthetic, unsynced, and error are mutually
exclusive — at most one is set per node. A successfully loaded real
manifest leaves all three at their default (false/None).
Fields§
§id: usizeStable in-walk identifier (depth-first, root = 0).
name: StringPack name (manifest name: for real packs, child path for
synthetic / unsynced / errored ones).
path: StringAbsolute on-disk path of the pack root.
pack_type: StringPack flavour discriminator. Snake-case label from
PackType::as_str — "meta", "declarative", or
"scripted".
synthetic: boolTrue iff the manifest was synthesised in-memory (plain-git
child). See man/reference/pack-spec.md §“Plain-git children”.
unsynced: boolTrue iff the child is declared in its parent’s manifest but its
destination directory is absent on disk. Distinguishes a
fresh-checkout state (which pre-FIX-4 was rendered as an empty
tree) from a fully-synced workspace. Skipped from JSON output
when false so the v1.1.1 baseline JSON shape is unchanged for
the common case.
error: Option<LsNodeError>Some when the child’s manifest exists but failed to read or
parse. Surfaces partial-corruption to JSON consumers without
aborting the entire walk. Skipped from JSON output when None.
children: Vec<LsNode>Recursively walked children. Empty for leaves (declarative and scripted packs and synthetic plain-git children).