pub struct CallGraph {
pub nodes: Vec<Node>,
pub edges: Vec<Edge>,
/* private fields */
}
Fields§
§nodes: Vec<Node>
§edges: Vec<Edge>
Implementations§
Source§impl CallGraph
impl CallGraph
pub fn new() -> Self
pub fn add_node( &mut self, name: String, node_type: NodeType, contract_name: Option<String>, visibility: Visibility, span: (usize, usize), ) -> usize
pub fn add_edge( &mut self, source_node_id: usize, target_node_id: usize, edge_type: EdgeType, call_site_span: (usize, usize), return_site_span: Option<(usize, usize)>, sequence_number: usize, returned_value: Option<String>, argument_names: Option<Vec<String>>, event_name: Option<String>, declared_return_type: Option<String>, )
Sourcepub fn iter_nodes(&self) -> impl Iterator<Item = &Node>
pub fn iter_nodes(&self) -> impl Iterator<Item = &Node>
Finds a node ID based on its name and potential contract scope. Resolution logic:
- Look for the name within the
current_contract
scope. - Look for the name as a free function (no contract scope).
- Fallback: Search across all known contract scopes. TODO: Enhance resolution with proper type analysis for member access, inheritance, imports, etc. This current fallback is a simplification and may be ambiguous if multiple
pub fn iter_edges(&self) -> impl Iterator<Item = &Edge>
pub fn add_explicit_return_edges( &mut self, input: &CallGraphGeneratorInput, ctx: &CallGraphGeneratorContext, ) -> Result<()>
Trait Implementations§
Source§impl CgToDot for CallGraph
impl CgToDot for CallGraph
Auto Trait Implementations§
impl Freeze for CallGraph
impl RefUnwindSafe for CallGraph
impl Send for CallGraph
impl Sync for CallGraph
impl Unpin for CallGraph
impl UnwindSafe for CallGraph
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