pub struct OwnershipGraph {
pub nodes: Vec<Node>,
pub edges: Vec<Edge>,
pub cycles: Vec<Vec<ObjectId>>,
pub arc_clone_count: usize,
}Expand description
Ownership graph representation
Fields§
§nodes: Vec<Node>All nodes in the graph
edges: Vec<Edge>All edges in the graph
cycles: Vec<Vec<ObjectId>>Detected cycles
arc_clone_count: usizeArc clone count for storm detection
Implementations§
Source§impl OwnershipGraph
impl OwnershipGraph
Sourcepub fn from_view(view: &MemoryView) -> Self
pub fn from_view(view: &MemoryView) -> Self
Build ownership graph from MemoryView.
Creates an ownership graph from the allocations in a MemoryView. This is a convenience method for the unified analyzer API.
Sourcepub fn build<T: AsRef<[OwnershipEvent]>>(
passports: &[(ObjectId, String, usize, T)],
) -> Self
pub fn build<T: AsRef<[OwnershipEvent]>>( passports: &[(ObjectId, String, usize, T)], ) -> Self
Build ownership graph from passports with ownership events
Sourcepub fn build_with_analysis<T: AsRef<[OwnershipEvent]>>(
passports: &[(ObjectId, String, usize, T)],
rustdoc_json_path: Option<&str>,
source_code: Option<&str>,
) -> Self
pub fn build_with_analysis<T: AsRef<[OwnershipEvent]>>( passports: &[(ObjectId, String, usize, T)], rustdoc_json_path: Option<&str>, source_code: Option<&str>, ) -> Self
Build ownership graph with four-layer analysis architecture
This method integrates:
- rustdoc JSON - type information for move vs copy judgment
- syn AST - parse source code to identify ownership events
- Static inference - ownership state tracking
- Runtime tracing (optional)
§Arguments
passports- Object passports with ownership eventsrustdoc_json_path- Optional path to rustdoc JSON for type infosource_code- Optional source code for AST analysis
Sourcepub fn has_arc_clone_storm(&self, threshold: usize) -> bool
pub fn has_arc_clone_storm(&self, threshold: usize) -> bool
Check if Arc clone storm is detected
Sourcepub fn arc_clones(&self) -> Vec<&Edge>
pub fn arc_clones(&self) -> Vec<&Edge>
Get all Arc clone edges
Sourcepub fn diagnostics(&self, arc_storm_threshold: usize) -> OwnershipDiagnostics
pub fn diagnostics(&self, arc_storm_threshold: usize) -> OwnershipDiagnostics
Generate diagnostics report for detected issues
Sourcepub fn find_root_cause(&self) -> Option<RootCauseChain>
pub fn find_root_cause(&self) -> Option<RootCauseChain>
Find root cause chain for memory growth
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 · 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 OwnershipGraph
impl Debug 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 UnsafeUnpin for OwnershipGraph
impl UnwindSafe for OwnershipGraph
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