pub struct LineTypes {
pub code: bool,
pub tests: bool,
pub examples: bool,
pub docs: bool,
pub comments: bool,
pub blanks: bool,
pub all: 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)all: 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
all: 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: all 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 all)
Sourcepub fn examples_only() -> Self
pub fn examples_only() -> Self
Include only example code (plus all)
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 without_all(self) -> Self
pub fn without_all(self) -> Self
Builder: disable all (total)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LineTypes
impl<'de> Deserialize<'de> for LineTypes
Source§fn 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
impl Copy for LineTypes
impl Eq for LineTypes
impl StructuralPartialEq for LineTypes
Auto Trait Implementations§
impl Freeze for LineTypes
impl RefUnwindSafe for LineTypes
impl Send for LineTypes
impl Sync for LineTypes
impl Unpin for LineTypes
impl UnwindSafe for LineTypes
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
Mutably borrows from an owned value. Read more