pub struct Lineage { /* private fields */ }Implementations§
Source§impl Lineage
impl Lineage
Sourcepub fn load(fur_dir: &Path) -> Result<Lineage, String>
pub fn load(fur_dir: &Path) -> Result<Lineage, String>
Build from .fur/threads/, reading the directory rather than the index
so a stale index.json cannot hide a conversation.
pub fn is_empty(&self) -> bool
pub fn is_local(&self, id: &str) -> bool
pub fn title(&self, id: &str) -> Option<&str>
Sourcepub fn would_cycle(&self, parent: &str, child: &str) -> bool
pub fn would_cycle(&self, parent: &str, child: &str) -> bool
Would linking parent → child close a loop? True when child can
already reach parent by following children.
Sourcepub fn ancestry(&self, start: &str) -> Vec<String>
pub fn ancestry(&self, start: &str) -> Vec<String>
Every local conversation reachable upward from start, in dependency
order: a conversation always appears after everything it draws on.
start is last. Absent conversations are skipped — there is nothing
local to print for them — but absent_ancestors reports them so the
document can say what it could not include.
Sourcepub fn descendants(&self, start: &str) -> Vec<String>
pub fn descendants(&self, start: &str) -> Vec<String>
Every local conversation reachable downward from start, in dependency
order: a conversation always appears after everything it draws on.
The reachable set is collected first, then ordered by walking upward within it — the same rule that orders ancestors. Ordering by descent would emit a diamond’s tip before one of its arms.
Sourcepub fn absent_ancestors(&self, start: &str) -> Vec<String>
pub fn absent_ancestors(&self, start: &str) -> Vec<String>
Ancestors of start that this project does not hold, so a provenance
document can name what it was unable to include.
Sourcepub fn parents_of(&self, id: &str) -> Vec<String>
pub fn parents_of(&self, id: &str) -> Vec<String>
Direct local parents of id, for the lineage map at the head of a
provenance document.
Sourcepub fn all_parents(&self, id: &str) -> Vec<String>
pub fn all_parents(&self, id: &str) -> Vec<String>
Parents of id, including ones this project does not hold.
Sourcepub fn all_children(&self, id: &str) -> Vec<String>
pub fn all_children(&self, id: &str) -> Vec<String>
Children of id, including ones this project does not hold.
Sourcepub fn asymmetric(&self) -> Vec<(String, String)>
pub fn asymmetric(&self) -> Vec<(String, String)>
Edges between two local conversations asserted from one side only.
Compares the raw claims, never the union — in the union a one-sided claim has already been mirrored for traversal, so checking it there could never report anything. Edges whose far end is absent are skipped: there is no local file that could hold the mirror.
Sourcepub fn forest(&self, order: &[String]) -> Vec<TreeEntry>
pub fn forest(&self, order: &[String]) -> Vec<TreeEntry>
Flatten the project into display order: roots first, children nested
beneath them, siblings in the order given by order.
order is the caller’s preferred sequence (newest first, typically);
it decides which root comes first and how siblings sort, while the
lineage decides the nesting. Conversations no root reaches — every
member of a cycle — are appended at the margin so nothing disappears.