Struct cargo_tarpaulin::traces::TraceMap
source · [−]pub struct TraceMap { /* private fields */ }
Expand description
Stores all the program traces mapped to files and provides an interface to add, query and change traces.
Implementations
sourceimpl TraceMap
impl TraceMap
sourcepub fn iter(&self) -> Iter<'_, PathBuf, Vec<Trace>>
pub fn iter(&self) -> Iter<'_, PathBuf, Vec<Trace>>
Provides an interator to the underlying map of PathBufs to Vec
sourcepub fn merge(&mut self, other: &TraceMap)
pub fn merge(&mut self, other: &TraceMap)
Merges the results of one tracemap into the current one. This adds records which are missing and adds the statistics gathered to existing records
sourcepub fn dedup(&mut self)
pub fn dedup(&mut self)
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
sourcepub fn add_trace(&mut self, file: &Path, trace: Trace)
pub fn add_trace(&mut self, file: &Path, trace: Trace)
Add a trace to the tracemap for the given file
pub fn add_file(&mut self, file: &Path)
sourcepub fn get_trace(&self, address: u64) -> Option<&Trace>
pub fn get_trace(&self, address: u64) -> Option<&Trace>
Gets an immutable reference to a trace from an address. Returns None if there is no trace at that address
pub fn increment_hit(&mut self, address: u64)
sourcepub fn get_trace_mut(&mut self, address: u64) -> Option<&mut Trace>
pub fn get_trace_mut(&mut self, address: u64) -> Option<&mut Trace>
Gets a mutable reference to a trace at a given address Returns None if there is no trace at that address
pub fn get_location(&self, address: u64) -> Option<Location>
sourcepub fn contains_location(&self, file: &Path, line: u64) -> bool
pub fn contains_location(&self, file: &Path, line: u64) -> bool
Returns true if the location described by file and line number is present in the tracemap
sourcepub fn contains_file(&self, file: &Path) -> bool
pub fn contains_file(&self, file: &Path) -> bool
Returns true if the file is among the traces
sourcepub fn get_child_traces<'a>(
&'a self,
root: &'a Path
) -> impl Iterator<Item = &'a Trace> + 'a
pub fn get_child_traces<'a>(
&'a self,
root: &'a Path
) -> impl Iterator<Item = &'a Trace> + 'a
Gets all traces below a certain path
sourcepub fn get_traces<'a>(
&'a self,
root: &'a Path
) -> impl Iterator<Item = &'a Trace> + 'a
pub fn get_traces<'a>(
&'a self,
root: &'a Path
) -> impl Iterator<Item = &'a Trace> + 'a
Gets all traces in folder, doesn’t go into other folders for that you want get_child_traces
sourcepub fn all_traces(&self) -> impl Iterator<Item = &Trace>
pub fn all_traces(&self) -> impl Iterator<Item = &Trace>
Gets all traces
pub fn files(&self) -> Vec<&PathBuf>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn coverable_in_path(&self, path: &Path) -> usize
pub fn covered_in_path(&self, path: &Path) -> usize
sourcepub fn total_coverable(&self) -> usize
pub fn total_coverable(&self) -> usize
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
sourcepub fn total_covered(&self) -> usize
pub fn total_covered(&self) -> usize
From all the coverable data return the amount covered
sourcepub fn coverage_percentage(&self) -> f64
pub fn coverage_percentage(&self) -> f64
Returns coverage percentage ranging from 0.0-1.0
Trait Implementations
sourceimpl<'de> Deserialize<'de> for TraceMap
impl<'de> Deserialize<'de> for TraceMap
sourcefn 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
sourceimpl From<&TraceMap> for CoverageReport
impl From<&TraceMap> for CoverageReport
Auto Trait Implementations
impl RefUnwindSafe for TraceMap
impl Send for TraceMap
impl Sync for TraceMap
impl Unpin for TraceMap
impl UnwindSafe for TraceMap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more