pub struct Edge {
pub source: String,
pub target: String,
pub edge_type: EdgeType,
pub ref_line: Option<usize>,
pub ident: Option<String>,
pub version_spec: Option<String>,
pub is_dev_dependency: Option<bool>,
}Expand description
An edge in the code graph representing a relationship between nodes.
Fields§
§source: StringSource node ID
target: StringTarget node ID
edge_type: EdgeTypeRelationship type
ref_line: Option<usize>Line number where the reference occurs (for USES edges)
ident: Option<String>The identifier text at the reference site (for USES/DEPENDS_ON edges)
version_spec: Option<String>Version specification (e.g., “workspace:*”, “^1.0.0”, “path:../core”)
is_dev_dependency: Option<bool>Whether this is a development dependency (devDependencies, dev-dependencies, etc.)
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn contains(parent: String, child: String) -> Self
pub fn contains(parent: String, child: String) -> Self
Create a CONTAINS edge (parent contains child)
Sourcepub fn uses(
source: String,
target: String,
ref_line: Option<usize>,
ident: Option<String>,
) -> Self
pub fn uses( source: String, target: String, ref_line: Option<usize>, ident: Option<String>, ) -> Self
Create a USES edge (source uses/references target)
Sourcepub fn defines(container: String, member: String) -> Self
pub fn defines(container: String, member: String) -> Self
Create a DEFINES edge (container defines member)
Sourcepub fn depends_on(
source: String,
target: String,
ident: Option<String>,
version_spec: Option<String>,
is_dev: Option<bool>,
) -> Self
pub fn depends_on( source: String, target: String, ident: Option<String>, version_spec: Option<String>, is_dev: Option<bool>, ) -> Self
Create a DEPENDS_ON edge (component depends on another component)
§Arguments
source- The dependent component node IDtarget- The dependency component node IDident- The dependency name as specified in manifest (e.g., “@myorg/core”)version_spec- Version specification (e.g., “workspace:*”, “^1.0.0”, “path:../core”)is_dev- Whether this is a development dependency
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Edge
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnwindSafe for Edge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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