Struct tokei::Stats [] [src]

pub struct Stats {
    pub blanks: usize,
    pub code: usize,
    pub comments: usize,
    pub lines: usize,
    pub name: PathBuf,
}

A struct representing the statistics of a file.

Fields

Number of blank lines within the file.

Number of lines of code within the file.

Number of comments within the file. (includes both multi line, and single line comments)

Total number of lines within the file.

File name.

Methods

impl Stats
[src]

[src]

Create a new Stats from a file path.

use std::path::PathBuf;
use tokei::Stats;

let path = PathBuf::from("src/main.rs");

let stats = Stats::new(path);

Trait Implementations

impl Clone for Stats
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Stats
[src]

[src]

Formats the value using the given formatter.

impl Eq for Stats
[src]

impl Ord for Stats
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialEq for Stats
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl PartialOrd for Stats
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Default for Stats
[src]

[src]

Returns the "default value" for a type. Read more

impl Display for Stats
[src]

[src]

Formats the value using the given formatter. Read more