Enum tokei::LanguageType[][src]

pub enum LanguageType {
    Abap,
    ActionScript,
    Ada,
    Agda,
    Alex,
    Asp,
    AspNet,
    Assembly,
    AutoHotKey,
    Autoconf,
    Bash,
    Batch,
    BrightScript,
    C,
    CHeader,
    CMake,
    CSharp,
    CShell,
    Cabal,
    Cassius,
    Ceylon,
    Clojure,
    ClojureC,
    ClojureScript,
    Cobol,
    CoffeeScript,
    Cogent,
    ColdFusion,
    ColdFusionScript,
    Coq,
    Cpp,
    CppHeader,
    Crystal,
    Css,
    D,
    Dart,
    DeviceTree,
    Dockerfile,
    DreamMaker,
    Edn,
    Elisp,
    Elixir,
    Elm,
    Elvish,
    EmacsDevEnv,
    Erlang,
    FEN,
    FSharp,
    Fish,
    Forth,
    FortranLegacy,
    FortranModern,
    Fstar,
    GdScript,
    Glsl,
    Go,
    Groovy,
    Hamlet,
    Handlebars,
    Happy,
    Haskell,
    Haxe,
    Hcl,
    Hex,
    Html,
    Idris,
    IntelHex,
    Isabelle,
    Jai,
    Java,
    JavaScript,
    Json,
    Jsx,
    Julia,
    Julius,
    KakouneScript,
    Kotlin,
    Lean,
    Less,
    LinkerScript,
    Lisp,
    Lua,
    Lucius,
    Madlang,
    Makefile,
    Markdown,
    Meson,
    Mint,
    ModuleDef,
    MsBuild,
    Mustache,
    Nim,
    Nix,
    OCaml,
    ObjectiveC,
    ObjectiveCpp,
    Org,
    Oz,
    PSL,
    Pascal,
    Perl,
    Php,
    Polly,
    Processing,
    Prolog,
    Protobuf,
    PureScript,
    Python,
    Qcl,
    Qml,
    R,
    Racket,
    Rakefile,
    Razor,
    ReStructuredText,
    Ruby,
    RubyHtml,
    Rust,
    SRecode,
    Sass,
    Scala,
    Scheme,
    Scons,
    Sh,
    Sml,
    SpecmanE,
    Spice,
    Sql,
    Svg,
    Swift,
    SystemVerilog,
    Tcl,
    Tex,
    Text,
    Toml,
    TypeScript,
    UnrealScript,
    UrWeb,
    UrWebProject,
    VB6,
    VBScript,
    Vala,
    Verilog,
    VerilogArgsFile,
    Vhdl,
    VimScript,
    VisualBasic,
    Vue,
    Wolfram,
    XSL,
    Xaml,
    Xml,
    Xtend,
    Yaml,
    Zig,
    Zsh,
}

Variants

Methods

impl LanguageType
[src]

Returns the display name of a language.

let bash = LanguageType::Bash;

assert_eq!(bash.name(), "BASH");

Important traits for Vec<u8>

Provides every variant in a Vec

Important traits for &'a [u8]

Returns the single line comments of a language.

use tokei::LanguageType;
let lang = LanguageType::Rust;
assert_eq!(lang.line_comments(), &["//"]);

Important traits for &'a [u8]

Returns the single line comments of a language.

use tokei::LanguageType;
let lang = LanguageType::Rust;
assert_eq!(lang.multi_line_comments(), &[("/*", "*/")]);

Returns whether the language allows nested multi line comments.

use tokei::LanguageType;
let lang = LanguageType::Rust;
assert!(lang.allows_nested());

Important traits for &'a [u8]

Returns what nested comments the language has. (Currently only D has any of this type.)

use tokei::LanguageType;
let lang = LanguageType::D;
assert_eq!(lang.nested_comments(), &[("/+", "+/")]);

Important traits for &'a [u8]

Returns the quotes of a language.

use tokei::LanguageType;
let lang = LanguageType::Rust;
assert_eq!(lang.quotes(), &[("r#\"", "\"#"), ("#\"", "\"#"), ("\"", "\"")]);

Get language from a file path. May open and read the file.

let rust = LanguageType::from_path("./main.rs");

assert_eq!(rust, Some(LanguageType::Rust));

Parses a given DirEntry using the LanguageType. Returning Stats on success.

Parses the text provided. Returning Stats on success.

Trait Implementations

impl Clone for LanguageType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for LanguageType
[src]

impl Debug for LanguageType
[src]

Formats the value using the given formatter. Read more

impl Eq for LanguageType
[src]

impl Ord for LanguageType
[src]

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialEq for LanguageType
[src]

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

This method tests for !=.

impl PartialOrd for LanguageType
[src]

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

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

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

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

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

impl FromStr for LanguageType
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Display for LanguageType
[src]

Formats the value using the given formatter. Read more

impl<'a> From<LanguageType> for Cow<'a, LanguageType>
[src]

Performs the conversion.

impl<'a> From<&'a LanguageType> for Cow<'a, LanguageType>
[src]

Performs the conversion.

Auto Trait Implementations