pub struct Edge {
pub src: NodeId,
pub dst: NodeId,
pub kind: EdgeKind,
pub line: Option<u32>,
pub confidence: EdgeConfidence,
}Expand description
A directed relationship between two nodes.
Fields§
§src: NodeId§dst: NodeId§kind: EdgeKind§line: Option<u32>Source line of the relationship’s origin, when meaningful. Set for
Calls edges (the line of the call expression) so call sites can be
pinpointed; None for structural edges (Contains, Implements, …).
confidence: EdgeConfidenceHow confident the indexer is this edge is real (see EdgeConfidence).
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(src: NodeId, dst: NodeId, kind: EdgeKind) -> Self
pub fn new(src: NodeId, dst: NodeId, kind: EdgeKind) -> Self
Construct an edge with no associated source line (structural edges).
Defaults to Extracted confidence.
Sourcepub fn call(src: NodeId, dst: NodeId, line: u32) -> Self
pub fn call(src: NodeId, dst: NodeId, line: u32) -> Self
Construct a Calls edge carrying the call-expression line.
Sourcepub fn with_confidence(self, confidence: EdgeConfidence) -> Self
pub fn with_confidence(self, confidence: EdgeConfidence) -> Self
Set the edge’s confidence (builder-style), e.g. mark a cross-file
name-resolved edge as Inferred.
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 UnsafeUnpin 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