Struct cargo_tarpaulin::source_analysis::LineAnalysis
source · [−]pub struct LineAnalysis {
pub ignore: HashSet<Lines>,
pub cover: HashSet<usize>,
pub logical_lines: HashMap<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
Implementations
sourceimpl 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
sourceimpl Clone for LineAnalysis
impl Clone for LineAnalysis
sourcefn clone(&self) -> LineAnalysis
fn clone(&self) -> LineAnalysis
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LineAnalysis
impl Debug for LineAnalysis
sourceimpl Default for LineAnalysis
impl Default for LineAnalysis
sourcefn default() -> LineAnalysis
fn default() -> LineAnalysis
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for LineAnalysis
impl Send for LineAnalysis
impl Sync for LineAnalysis
impl Unpin for LineAnalysis
impl UnwindSafe for LineAnalysis
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