[][src]Struct tokei::Config

pub struct Config {
    pub columns: Option<usize>,
    pub treat_doc_strings_as_comments: Option<bool>,
    pub types: Option<Vec<LanguageType>>,
}

A configuration struct for how Languages::get_statistics searches and counts languages.

use tokei::Config;

let config = Config {
    treat_doc_strings_as_comments: Some(true),
    ..Config::default()
};

Fields

columns: Option<usize>

Number columns to print. (Only used in the CLI).

treat_doc_strings_as_comments: Option<bool>

Whether to treat doc strings in languages as comments. By default this will be false.

types: Option<Vec<LanguageType>>

Filters languages searched to just those provided. E.g. A directory containing C, Cpp, and Rust with a Config.types of [Cpp, Rust] will count only Cpp and Rust.

Methods

impl Config
[src]

pub fn from_config_files() -> Self
[src]

Creates a Config from two configuration files if they are available. Files can have two different names tokei.toml and .tokeirc. Firstly it will attempt to find a config in the configuration directory (see below), and secondly from the current directory. The current directory's configuration will take priority over the configuration directory.

Platform Value Example
Linux $XDG_DATA_HOME or $HOME/.local/share /home/alice/.local/share
macOS $HOME/Library/Application Support /Users/Alice/Library/Application Support
Windows {FOLDERID_RoamingAppData} C:\Users\Alice\AppData\Roaming

Example

columns = 80
types = ["Python"]
treat_doc_strings_as_comments = true

Trait Implementations

impl Default for Config
[src]

impl Debug for Config
[src]

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

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Erased for T

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