Data

Struct Data 

Source
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: usize

Current index of the vector.

§metadata: FileMetadata

File metadata (connection type, version, etc.)

Implementations§

Source§

impl Data

Source

pub fn get_current_trace(&self) -> Option<&Trace>

return the current trace

Source

pub fn is_different_index(&self, index: usize) -> bool

return if the index is different from the current index

Source

pub fn clear(&mut self)

clear the data

Source

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 for
  • rules - The association rules to use for matching
§Returns
  • The parent index if found, None otherwise
Source

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.

Source

pub fn get_parent_trace( &mut self, index: usize, rules: &AssociationRules, ) -> Option<&Trace>

Get the parent trace for a trace at the given index. This will compute the association if not already done.

§Arguments
  • index - Index of the trace
  • rules - The association rules to use
§Returns
  • Reference to the parent trace if found
Source

pub fn get_child_trace(&self, index: usize) -> Option<&Trace>

Get the child trace for a trace at the given index. Note: child relation is set when the child’s parent is computed.

§Arguments
  • index - Index of the trace
§Returns
  • Reference to the child trace if found
Source

pub fn invalidate_associations(&mut self)

Invalidate all associations (useful when new traces are added)

Source

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 added
  • window - Window size to invalidate around the new traces

Trait Implementations§

Source§

impl Debug for Data

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Data

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Data

§

impl RefUnwindSafe for Data

§

impl Send for Data

§

impl Sync for Data

§

impl Unpin for Data

§

impl UnwindSafe for Data

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,