pub struct Locs {
pub code: u64,
pub tests: u64,
pub examples: u64,
pub docs: u64,
pub comments: u64,
pub blanks: u64,
pub total: u64,
}Expand description
Lines of code counts with 7 line types.
This is the fundamental unit of measurement in rustloc. Each field counts a specific type of line:
code,tests,examples: Actual executable/logic lines, distinguished by contextdocs,comments,blanks: Metadata lines, counted regardless of locationtotal: Precomputed sum of all line types (total line count)
Fields§
§code: u64Logic lines in production code (src/, not in test blocks)
tests: u64Logic lines in test code (#test, #[cfg(test)], tests/ directory)
examples: u64Logic lines in example code (examples/ directory)
docs: u64Documentation comment lines (///, //!, /** /, /! */)
comments: u64Regular comment lines (//, /* */)
blanks: u64Blank lines (whitespace only)
total: u64Total line count (sum of all types)
Implementations§
Source§impl Locs
impl Locs
Sourcepub fn total_logic(&self) -> u64
pub fn total_logic(&self) -> u64
Total logic lines (code + tests + examples).
Sourcepub fn recompute_total(&mut self)
pub fn recompute_total(&mut self)
Recompute the total field from individual line types.
Call this after manually setting individual fields.
Trait Implementations§
Source§impl AddAssign for Locs
impl AddAssign for Locs
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl<'de> Deserialize<'de> for Locs
impl<'de> Deserialize<'de> for Locs
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
Source§impl SubAssign for Locs
impl SubAssign for Locs
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl Copy for Locs
impl Eq for Locs
impl StructuralPartialEq for Locs
Auto Trait Implementations§
impl Freeze for Locs
impl RefUnwindSafe for Locs
impl Send for Locs
impl Sync for Locs
impl Unpin for Locs
impl UnsafeUnpin for Locs
impl UnwindSafe for Locs
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