[][src]Struct tokei::Config

pub struct Config {
    pub columns: Option<usize>,
    pub hidden: Option<bool>,
    pub no_ignore: Option<bool>,
    pub no_ignore_parent: Option<bool>,
    pub no_ignore_vcs: Option<bool>,
    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>

Width of columns to be printed to the terminal. This option is ignored in the library. Default: Auto detected width of the terminal.

hidden: Option<bool>

Count hidden files and directories. Default: false.

no_ignore: Option<bool>

Don't respect ignore files. Default: false.

no_ignore_parent: Option<bool>

Don't respect ignore files in parent directories. Default: false.

no_ignore_vcs: Option<bool>

Don't respect VCS ignore files. Default: false.

treat_doc_strings_as_comments: Option<bool>

Whether to treat doc strings in languages as comments. Default: 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. Default: None.

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.

PlatformValueExample
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 Debug for Config[src]

impl Default for Config[src]

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

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

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: Deserialize<'de>, 
[src]

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

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

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.