Struct cargo_tarpaulin::source_analysis::LineAnalysis
source · pub struct LineAnalysis {
pub ignore: HashSet<Lines>,
pub cover: HashSet<usize>,
pub logical_lines: HashMap<usize, usize>,
pub functions: HashMap<String, (usize, usize)>,
/* private fields */
}
Expand description
Represents the results of analysis of a single file. Does not store the file in question as this is expected to be maintained by the user.
Fields§
§ignore: HashSet<Lines>
This represents lines that should be ignored in coverage but may be identifed as coverable in the DWARF tables
cover: HashSet<usize>
This represents lines that should be included in coverage But may be ignored. Doesn’t make sense to cover ALL the lines so this is just an index.
logical_lines: HashMap<usize, usize>
Some logical lines may be split between physical lines this shows the mapping from physical line to logical line to prevent false positives from expressions split across physical lines
functions: HashMap<String, (usize, usize)>
Implementations§
source§impl LineAnalysis
impl LineAnalysis
sourcepub fn ignore_all(&mut self)
pub fn ignore_all(&mut self)
Ignore all lines in the file
sourcepub fn ignore_tokens<T>(&mut self, tokens: T)where
T: ToTokens,
pub fn ignore_tokens<T>(&mut self, tokens: T)where
T: ToTokens,
Ignore all tokens in the given token stream
sourcepub fn ignore_span(&mut self, span: Span)
pub fn ignore_span(&mut self, span: Span)
Adds the lines of the provided span to the ignore set
sourcepub fn cover_token_stream(
&mut self,
tokens: TokenStream,
contents: Option<&str>,
)
pub fn cover_token_stream( &mut self, tokens: TokenStream, contents: Option<&str>, )
Cover all tokens in the given tokenstream
sourcepub fn cover_span(&mut self, span: Span, contents: Option<&str>)
pub fn cover_span(&mut self, span: Span, contents: Option<&str>)
Adds the lines of the provided span to the cover set
sourcepub fn should_ignore(&self, line: usize) -> bool
pub fn should_ignore(&self, line: usize) -> bool
Shows whether the line should be ignored by tarpaulin
Trait Implementations§
source§impl Clone for LineAnalysis
impl Clone for LineAnalysis
source§fn clone(&self) -> LineAnalysis
fn clone(&self) -> LineAnalysis
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LineAnalysis
impl Debug for LineAnalysis
source§impl Default for LineAnalysis
impl Default for LineAnalysis
source§fn default() -> LineAnalysis
fn default() -> LineAnalysis
Auto Trait Implementations§
impl Freeze for LineAnalysis
impl RefUnwindSafe for LineAnalysis
impl Send for LineAnalysis
impl Sync for LineAnalysis
impl Unpin for LineAnalysis
impl UnwindSafe for LineAnalysis
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)