Struct tokei::Stats [] [src]

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

A struct representing the statistics of a file.

Fields

blanks: usize

Number of blank lines within the file.

code: usize

Number of lines of code within the file.

comments: usize

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

lines: usize

Total number of lines within the file.

name: String

File name.

Methods

impl Stats
[src]

fn new<S: Into<String>>(name: S) -> Self

Create a new Stats from a file path.

let stats = Stats::new("src/main.rs");

Trait Implementations

impl PartialOrd for Stats
[src]

fn partial_cmp(&self, __arg_0: &Stats) -> Option<Ordering>

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

fn lt(&self, __arg_0: &Stats) -> bool

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

fn le(&self, __arg_0: &Stats) -> bool

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

fn gt(&self, __arg_0: &Stats) -> bool

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

fn ge(&self, __arg_0: &Stats) -> bool

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

impl PartialEq for Stats
[src]

fn eq(&self, __arg_0: &Stats) -> bool

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

fn ne(&self, __arg_0: &Stats) -> bool

This method tests for !=.

impl Ord for Stats
[src]

fn cmp(&self, __arg_0: &Stats) -> Ordering

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

impl Eq for Stats
[src]

impl Debug for Stats
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Default for Stats
[src]

fn default() -> Stats

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

impl Clone for Stats
[src]

fn clone(&self) -> Stats

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Display for Stats
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.