pub struct Edge {
pub src: i64,
pub dst: i64,
pub type: EdgeType,
pub property: Vec<EdgeProperty>,
}
Expand description
Represents an edge in a Code Property Graph.
Edges represent relationships between nodes, such as method calls, control flow, data flow, etc. Each edge has a source node, a destination node, a type, and optional properties.
§Examples
use cpg_rs::{Edge, EdgeType};
// Create an edge from node 1 to node 2
let edge = Edge {
src: 1,
dst: 2,
r#type: EdgeType::Ast,
property: vec![],
};
Fields§
§src: i64
Source node.
dst: i64
Destination node.
type: EdgeType
§property: Vec<EdgeProperty>
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 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