Struct tokei::Language [−][src]
pub struct Language { pub blanks: usize, pub code: usize, pub comments: usize, pub lines: usize, pub stats: Vec<Stats>, }
Struct representing a single Language.
Fields
blanks: usize
Number of blank lines.
code: usize
Number of lines of code.
comments: usize
Number of comments(both single, and multi-line)
lines: usize
Number of total lines.
stats: Vec<Stats>
A collection of statistics based on the files provide from files
Methods
impl Language
[src]
impl Language
pub fn new() -> Self
[src]
pub fn new() -> Self
Constructs a new empty Language with the comments provided.
let mut rust = Language::new();
pub fn add_stat(&mut self, stat: Stats)
[src]
pub fn add_stat(&mut self, stat: Stats)
Adds file stats to the Language.
pub fn total(&mut self)
[src]
pub fn total(&mut self)
Totals up all the statistics currently in the language.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Checks if the language is empty. Empty meaning it doesn't have any statistics.
let rust = Language::new(); assert!(rust.is_empty());
pub fn sort_by(&mut self, category: Sort)
[src]
pub fn sort_by(&mut self, category: Sort)
Sorts each of the Stats
structs contained in the language based
on what category is provided
panic!'s if given the wrong category.
Trait Implementations
impl Clone for Language
[src]
impl Clone for Language
fn clone(&self) -> Language
[src]
fn clone(&self) -> Language
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Language
[src]
impl Debug for Language
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Language
[src]
impl Default for Language
impl AddAssign for Language
[src]
impl AddAssign for Language
fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation.