pub struct Data {
pub events: Vec<Trace>,
pub current_index: usize,
pub metadata: FileMetadata,
}Expand description
Data structure to store Trace of the application.
Fields§
§events: Vec<Trace>Vector of Trace.
current_index: usizeCurrent index of the vector.
metadata: FileMetadataFile metadata (connection type, version, etc.)
Implementations§
Source§impl Data
impl Data
Sourcepub fn get_current_trace(&self) -> Option<&Trace>
pub fn get_current_trace(&self) -> Option<&Trace>
return the current trace
Sourcepub fn is_different_index(&self, index: usize) -> bool
pub fn is_different_index(&self, index: usize) -> bool
return if the index is different from the current index
Sourcepub fn compute_parent(
&mut self,
index: usize,
rules: &AssociationRules,
) -> Option<usize>
pub fn compute_parent( &mut self, index: usize, rules: &AssociationRules, ) -> Option<usize>
Compute parent association for a trace at the given index using lazy evaluation. If already computed, returns the cached result. Otherwise, computes and caches it.
§Arguments
index- Index of the trace to compute parent forrules- The association rules to use for matching
§Returns
- The parent index if found, None otherwise
Sourcepub fn compute_all_associations(&mut self, rules: &AssociationRules)
pub fn compute_all_associations(&mut self, rules: &AssociationRules)
Compute all associations for all traces in the events vector. This applies all rules to each trace automatically:
- For each trace, finds rules where the trace’s layer is the source layer
- Computes the relationship and updates both parent (on source) and child (on target)
After calling this method, you can use trace.relation.get_parent_index() or
trace.relation.get_child_index() to get related traces.
Sourcepub fn get_parent_trace(
&mut self,
index: usize,
rules: &AssociationRules,
) -> Option<&Trace>
pub fn get_parent_trace( &mut self, index: usize, rules: &AssociationRules, ) -> Option<&Trace>
Sourcepub fn get_child_trace(&self, index: usize) -> Option<&Trace>
pub fn get_child_trace(&self, index: usize) -> Option<&Trace>
Sourcepub fn invalidate_associations(&mut self)
pub fn invalidate_associations(&mut self)
Invalidate all associations (useful when new traces are added)
Sourcepub fn invalidate_associations_in_range(
&mut self,
start_index: usize,
window: usize,
)
pub fn invalidate_associations_in_range( &mut self, start_index: usize, window: usize, )
Invalidate associations in a range around newly added traces This is more efficient than invalidating all associations
§Arguments
start_index- Start of the range where new traces were addedwindow- Window size to invalidate around the new traces