pub struct LineTypes {
pub code: bool,
pub tests: bool,
pub examples: bool,
pub docs: bool,
pub comments: bool,
pub blanks: bool,
pub total: bool,
}Expand description
Filter for which line types to include in results.
The 7 line types are:
code: Production code logic linestests: Test code logic linesexamples: Example code logic linesdocs: Documentation comments (anywhere)comments: Regular comments (anywhere)blanks: Blank lines (anywhere)total: Total line count (precomputed sum of all types)
When a line type is disabled, it will be zeroed in returned stats.
Fields§
§code: boolInclude production code logic lines
tests: boolInclude test code logic lines
examples: boolInclude example code logic lines
docs: boolInclude documentation comment lines
comments: boolInclude regular comment lines
blanks: boolInclude blank lines
total: boolInclude total line count (precomputed)
Implementations§
Source§impl LineTypes
impl LineTypes
Sourcepub fn new() -> Self
pub fn new() -> Self
Create with no types enabled (for building up).
Note: total defaults to true since it’s always useful to see totals.
Sourcepub fn everything() -> Self
pub fn everything() -> Self
Include all line types
Sourcepub fn tests_only() -> Self
pub fn tests_only() -> Self
Include only test code (plus total)
Sourcepub fn examples_only() -> Self
pub fn examples_only() -> Self
Include only example code (plus total)
Sourcepub fn logic_only() -> Self
pub fn logic_only() -> Self
Include all logic lines (code + tests + examples + all)
Sourcepub fn with_tests(self) -> Self
pub fn with_tests(self) -> Self
Builder: enable tests
Sourcepub fn with_examples(self) -> Self
pub fn with_examples(self) -> Self
Builder: enable examples
Sourcepub fn with_comments(self) -> Self
pub fn with_comments(self) -> Self
Builder: enable comments
Sourcepub fn with_blanks(self) -> Self
pub fn with_blanks(self) -> Self
Builder: enable blanks
Sourcepub fn with_total(self) -> Self
pub fn with_total(self) -> Self
Builder: enable total
Sourcepub fn without_total(self) -> Self
pub fn without_total(self) -> Self
Builder: disable total