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 more