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).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LsNode
impl RefUnwindSafe for LsNode
impl Send for LsNode
impl Sync for LsNode
impl Unpin for LsNode
impl UnsafeUnpin for LsNode
impl UnwindSafe for LsNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more