pub struct Edge {
pub src: NodeId,
pub dst: NodeId,
pub relation: Relation,
pub evidence: Evidence,
pub confidence: Confidence,
pub site: Option<Span>,
pub extra_sites: Vec<Span>,
pub sites_total: u32,
}Expand description
Directed edge src -> dst. The graph is a multigraph: parallel edges
that differ in relation, evidence, or confidence coexist.
Fields§
§src: NodeId§dst: NodeId§relation: Relation§evidence: Evidence§confidence: Confidence§site: Option<Span>Byte span of the binding reference in the src node’s file (the file
is derivable from src). None when no single site exists:
containment, dynamic fan-out, implements/extends pairing, declared
links. When several sites bind the same (src, dst, relation,
evidence), this is the representative (smallest) one — the field is
after identity so identity orders first.
extra_sites: Vec<Span>Further sites binding the same identity, ascending, capped so that
1 + extra_sites.len() <= MAX_SITES. Empty for a single-site edge.
sites_total: u32Distinct sites observed for this identity, including the ones the cap dropped. 0 when the edge has no site at all.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn single(
src: NodeId,
dst: NodeId,
relation: Relation,
evidence: Evidence,
confidence: Confidence,
site: Option<Span>,
) -> Self
pub fn single( src: NodeId, dst: NodeId, relation: Relation, evidence: Evidence, confidence: Confidence, site: Option<Span>, ) -> Self
Identity without the site: two edges equal here are the same dependency fact observed at (possibly) different call sites. One edge with a single site: the shape extraction and resolution produce, before storage merges same-identity sites together.
Sourcepub fn sites(&self) -> impl Iterator<Item = Span> + '_
pub fn sites(&self) -> impl Iterator<Item = Span> + '_
Every kept site, ascending (representative first). Empty when the edge has none.
Sourcepub fn sites_omitted(&self) -> u32
pub fn sites_omitted(&self) -> u32
Sites this edge has beyond the ones it kept.