[][src]Struct tokei::CodeStats

#[non_exhaustive]pub struct CodeStats {
    pub blanks: usize,
    pub code: usize,
    pub comments: usize,
    pub blobs: BTreeMap<LanguageType, CodeStats>,
}

A struct representing stats about a single blob of code.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
blanks: usize

The blank lines in the blob.

code: usize

The lines of code in the blob.

comments: usize

The lines of comments in the blob.

blobs: BTreeMap<LanguageType, CodeStats>

Language blobs that were contained inside this blob.

Implementations

impl CodeStats[src]

pub fn new() -> Self[src]

Creates a new blank CodeStats.

pub fn lines(&self) -> usize[src]

Get the total lines in a blob of code.

pub fn summarise(&self) -> Self[src]

Creates a new CodeStats from an existing one with all of the child blobs merged.

Trait Implementations

impl Add<CodeStats> for CodeStats[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<CodeStats> for CodeStats[src]

impl AddAssign<CodeStats> for Report[src]

impl Clone for CodeStats[src]

impl Debug for CodeStats[src]

impl Default for CodeStats[src]

impl<'de> Deserialize<'de> for CodeStats[src]

impl PartialEq<CodeStats> for CodeStats[src]

impl Serialize for CodeStats[src]

impl StructuralPartialEq for CodeStats[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.