pub struct RelationGraph {
pub edges: Vec<RelationEdge>,
}Expand description
A relation graph connecting allocations.
Fields§
§edges: Vec<RelationEdge>All edges in the graph.
Implementations§
Source§impl RelationGraph
impl RelationGraph
Sourcepub fn from_view(view: &MemoryView) -> Self
pub fn from_view(view: &MemoryView) -> Self
Build relation graph from MemoryView.
Creates a relation graph from the allocations in a MemoryView. This is a convenience method for the unified analyzer API.
Sourcepub fn add_edge(&mut self, from: usize, to: usize, relation: Relation)
pub fn add_edge(&mut self, from: usize, to: usize, relation: Relation)
Add a single edge to the graph.
Does not add duplicate edges (same from/to/relation).
Sourcepub fn add_edges(&mut self, edges: Vec<RelationEdge>)
pub fn add_edges(&mut self, edges: Vec<RelationEdge>)
Add multiple edges at once.
Sourcepub fn get_inbound_edges(&self, node: usize) -> Vec<&RelationEdge>
pub fn get_inbound_edges(&self, node: usize) -> Vec<&RelationEdge>
Get all inbound edges to a given node.
Sourcepub fn get_outbound_edges(&self, node: usize) -> Vec<&RelationEdge>
pub fn get_outbound_edges(&self, node: usize) -> Vec<&RelationEdge>
Get all outbound edges from a given node.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges in the graph.
Trait Implementations§
Source§impl Clone for RelationGraph
impl Clone for RelationGraph
Source§fn clone(&self) -> RelationGraph
fn clone(&self) -> RelationGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelationGraph
impl Debug for RelationGraph
Source§impl Default for RelationGraph
impl Default for RelationGraph
Source§fn default() -> RelationGraph
fn default() -> RelationGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RelationGraph
impl RefUnwindSafe for RelationGraph
impl Send for RelationGraph
impl Sync for RelationGraph
impl Unpin for RelationGraph
impl UnsafeUnpin for RelationGraph
impl UnwindSafe for RelationGraph
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<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