Skip to main content

Lineage

Struct Lineage 

Source
pub struct Lineage { /* private fields */ }

Implementations§

Source§

impl Lineage

Source

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.

Source

pub fn is_empty(&self) -> bool

Source

pub fn is_local(&self, id: &str) -> bool

Source

pub fn title(&self, id: &str) -> Option<&str>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn ids(&self) -> Vec<String>

Every local conversation, sorted.

Source

pub fn all_parents(&self, id: &str) -> Vec<String>

Parents of id, including ones this project does not hold.

Source

pub fn all_children(&self, id: &str) -> Vec<String>

Children of id, including ones this project does not hold.

Source

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.

Source

pub fn dangling(&self) -> Vec<String>

Conversation ids that nothing local holds as a parent.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more