pub struct OwnershipGraph {
pub nodes: Vec<Variable>,
pub edges: Vec<Relationship>,
}Expand description
The complete ownership graph built from events.
Fields§
§nodes: Vec<Variable>Variable nodes
edges: Vec<Relationship>Relationship edges
Implementations§
Source§impl OwnershipGraph
impl OwnershipGraph
Sourcepub fn add_variable(&mut self, var: Variable)
pub fn add_variable(&mut self, var: Variable)
Add a variable node.
Sourcepub fn add_relationship(&mut self, rel: Relationship)
pub fn add_relationship(&mut self, rel: Relationship)
Add a relationship edge.
Sourcepub fn find_variable(&self, id: &str) -> Option<&Variable>
pub fn find_variable(&self, id: &str) -> Option<&Variable>
Find a variable by ID.
Sourcepub fn find_borrows(&self, var_id: &str) -> Vec<&Relationship>
pub fn find_borrows(&self, var_id: &str) -> Vec<&Relationship>
Find all borrows of a variable.
Sourcepub fn stats(&self) -> GraphStats
pub fn stats(&self) -> GraphStats
Get statistics
Sourcepub fn lifetime_relations(&self, events: &[Event]) -> Vec<LifetimeRelation>
pub fn lifetime_relations(&self, events: &[Event]) -> Vec<LifetimeRelation>
Get lifetime relations from the graph
Sourcepub fn create_timeline(&self, events: &[Event]) -> Timeline
pub fn create_timeline(&self, events: &[Event]) -> Timeline
Create a timeline visualization from events
Sourcepub fn active_borrows_at(
&self,
events: &[Event],
timestamp: u64,
) -> Vec<LifetimeRelation>
pub fn active_borrows_at( &self, events: &[Event], timestamp: u64, ) -> Vec<LifetimeRelation>
Get all active borrows at a specific timestamp
Trait Implementations§
Source§impl Clone for OwnershipGraph
impl Clone for OwnershipGraph
Source§fn clone(&self) -> OwnershipGraph
fn clone(&self) -> OwnershipGraph
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OwnershipGraph
impl Debug for OwnershipGraph
Source§impl Default for OwnershipGraph
impl Default for OwnershipGraph
Source§impl<'de> Deserialize<'de> for OwnershipGraph
impl<'de> Deserialize<'de> for OwnershipGraph
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
Auto Trait Implementations§
impl Freeze for OwnershipGraph
impl RefUnwindSafe for OwnershipGraph
impl Send for OwnershipGraph
impl Sync for OwnershipGraph
impl Unpin for OwnershipGraph
impl UnwindSafe for OwnershipGraph
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)