Struct ImportGraph
pub struct ImportGraph {
pub id_to_path: Vec<String>,
pub path_to_id: HashMap<String, usize>,
pub adj: Vec<Vec<usize>>,
}Expand description
The directed structural import graph. Nodes are repo-relative paths:
every live Tier-1 source file, plus any resolved import endpoint. A
file that neither imports nor is imported is still a node (a singleton
with empty adjacency), so isolated files are counted in n. Edges are
src → target (“src imports target”).
Fields§
§id_to_path: Vec<String>Dense node id → path.
path_to_id: HashMap<String, usize>Path → dense node id.
adj: Vec<Vec<usize>>Adjacency: adj[u] is the set of nodes u imports (deduped,
self-loops removed).
Implementations§
§impl ImportGraph
impl ImportGraph
pub fn resolved_edges(&self) -> Vec<(&str, &str)>
pub fn resolved_edges(&self) -> Vec<(&str, &str)>
The resolved (src_path, target_path) edges as borrowed pairs, in
adjacency order. Lets facts::ingest materialize a historical import
table from a graph the analyses layer built without facts naming the
ImportGraph type (the analyses→facts layering only points one way).
Auto Trait Implementations§
impl Freeze for ImportGraph
impl RefUnwindSafe for ImportGraph
impl Send for ImportGraph
impl Sync for ImportGraph
impl Unpin for ImportGraph
impl UnsafeUnpin for ImportGraph
impl UnwindSafe for ImportGraph
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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