pub struct CodeGraph {
pub graph: DiGraph<i64, EdgeKind>,
pub file_symbols: HashMap<i64, Vec<i64>>,
/* private fields */
}Fields§
§graph: DiGraph<i64, EdgeKind>§file_symbols: HashMap<i64, Vec<i64>>file node id → symbol node ids inside it
Implementations§
Source§impl CodeGraph
impl CodeGraph
pub fn load(conn: &Connection, project_id: i64) -> Result<CodeGraph>
Sourcepub fn callers(&self, id: i64, depth: usize) -> Vec<Reached>
pub fn callers(&self, id: i64, depth: usize) -> Vec<Reached>
Who (transitively) calls id, up to depth hops, nearest first.
Sourcepub fn calls(&self, id: i64, depth: usize) -> Vec<Reached>
pub fn calls(&self, id: i64, depth: usize) -> Vec<Reached>
What id (transitively) calls, up to depth hops.
Sourcepub fn impact(&self, seeds: &[i64], depth: usize) -> Vec<Reached>
pub fn impact(&self, seeds: &[i64], depth: usize) -> Vec<Reached>
Blast radius of changing the given symbols (or whole files): reverse calls + reverse imports, depth-capped.
Sourcepub fn path(&self, a: i64, b: i64) -> Option<Vec<i64>>
pub fn path(&self, a: i64, b: i64) -> Option<Vec<i64>>
Shortest call path a → b (forward over calls).
Auto Trait Implementations§
impl Freeze for CodeGraph
impl RefUnwindSafe for CodeGraph
impl Send for CodeGraph
impl Sync for CodeGraph
impl Unpin for CodeGraph
impl UnsafeUnpin for CodeGraph
impl UnwindSafe for CodeGraph
Blanket Implementations§
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