[][src]Struct tarp::traces::TraceMap

pub struct TraceMap { /* fields omitted */ }

Stores all the program traces mapped to files and provides an interface to add, query and change traces.

Methods

impl TraceMap[src]

pub fn new() -> TraceMap[src]

Create a new TraceMap

pub fn is_empty(&self) -> bool[src]

Returns true if there are no traces

pub fn iter(&self) -> Iter<PathBuf, Vec<Trace>>[src]

Provides an interator to the underlying map of PathBufs to Vec

pub fn merge(&mut self, other: &TraceMap)[src]

Merges the results of one tracemap into the current one. This adds records which are missing and adds the statistics gathered to existing records

pub fn dedup(&mut self)[src]

This will collapse duplicate Traces into a single trace. Warning this will lose the addresses of the duplicate traces but increment the results should be called only if you don't need those addresses from then on TODO possibly not the cleanest solution

pub fn add_trace(&mut self, file: &Path, trace: Trace)[src]

Add a trace to the tracemap for the given file

pub fn get_trace(&self, address: u64) -> Option<&Trace>[src]

Gets an immutable reference to a trace from an address. Returns None if there is no trace at that address

pub fn get_trace_mut(&mut self, address: u64) -> Option<&mut Trace>[src]

Gets a mutable reference to a trace at a given address Returns None if there is no trace at that address

pub fn contains_location(&self, file: &Path, line: u64) -> bool[src]

Returns true if the location described by file and line number is present in the tracemap

pub fn contains_file(&self, file: &Path) -> bool[src]

Returns true if the file is among the traces

pub fn get_child_traces(&self, root: &Path) -> Vec<&Trace>[src]

Gets all traces below a certain path

pub fn get_traces(&self, root: &Path) -> Vec<&Trace>[src]

Gets all traces in folder, doesn't go into other folders for that you want get_child_traces

pub fn all_traces(&self) -> Vec<&Trace>[src]

Gets all traces

pub fn files(&self) -> Vec<&PathBuf>[src]

pub fn coverable_in_path(&self, path: &Path) -> usize[src]

pub fn covered_in_path(&self, path: &Path) -> usize[src]

pub fn total_coverable(&self) -> usize[src]

Give the total amount of coverable points in the code. This will vary based on the statistics available for line coverage it will be total lines whereas for condition or decision it will count the number of conditions available

pub fn total_covered(&self) -> usize[src]

From all the coverable data return the amount covered

pub fn coverage_percentage(&self) -> f64[src]

Returns coverage percentage ranging from 0.0-1.0

Trait Implementations

impl Debug for TraceMap[src]

impl Default for TraceMap[src]

impl<'de> Deserialize<'de> for TraceMap[src]

impl Serialize for TraceMap[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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