Skip to main content

GraphContext

Trait GraphContext 

Source
pub trait GraphContext {
    // Required methods
    fn children(&self, cid: &CommitCid) -> Vec<&CommitCid>;
    fn parents(&self, cid: &CommitCid) -> Vec<&CommitCid>;
    fn commit(&self, cid: &CommitCid) -> Option<&VoidCommit>;
}
Expand description

Context providing commit relationships for graph calculation.

This trait abstracts the repository interface so the graph algorithm can work with different commit sources.

Required Methods§

Source

fn children(&self, cid: &CommitCid) -> Vec<&CommitCid>

Get children CIDs for a commit (commits that have this as parent).

Source

fn parents(&self, cid: &CommitCid) -> Vec<&CommitCid>

Get parent CIDs for a commit.

Source

fn commit(&self, cid: &CommitCid) -> Option<&VoidCommit>

Get a commit by CID (returns None if not in the graph).

Implementors§