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
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
Methods
impl LanguageType
[src]
impl LanguageType
pub fn name(self) -> &'static str
[src]
pub fn name(self) -> &'static str
Returns the display name of a language.
let bash = LanguageType::Bash; assert_eq!(bash.name(), "BASH");
pub fn list() -> Vec<Self>
[src]
pub fn list() -> Vec<Self>
Provides every variant in a Vec
pub fn line_comments(self) -> &'static [&'static str]
[src]
pub fn line_comments(self) -> &'static [&'static str]
Returns the single line comments of a language.
use tokei::LanguageType; let lang = LanguageType::Rust; assert_eq!(lang.line_comments(), &["//"]);
pub fn multi_line_comments(self) -> &'static [(&'static str, &'static str)]
[src]
pub fn multi_line_comments(self) -> &'static [(&'static str, &'static str)]
Returns the single line comments of a language.
use tokei::LanguageType; let lang = LanguageType::Rust; assert_eq!(lang.multi_line_comments(), &[("/*", "*/")]);
pub fn allows_nested(self) -> bool
[src]
pub fn allows_nested(self) -> bool
Returns whether the language allows nested multi line comments.
use tokei::LanguageType; let lang = LanguageType::Rust; assert!(lang.allows_nested());
pub fn nested_comments(self) -> &'static [(&'static str, &'static str)]
[src]
pub fn nested_comments(self) -> &'static [(&'static str, &'static str)]
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(), &[("/+", "+/")]);
pub fn quotes(self) -> &'static [(&'static str, &'static str)]
[src]
pub fn quotes(self) -> &'static [(&'static str, &'static str)]
Returns the quotes of a language.
use tokei::LanguageType; let lang = LanguageType::Rust; assert_eq!(lang.quotes(), &[("r#\"", "\"#"), ("#\"", "\"#"), ("\"", "\"")]);
pub fn from_path<P: AsRef<Path>>(entry: P) -> Option<Self>
[src]
pub fn from_path<P: AsRef<Path>>(entry: P) -> Option<Self>
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));
pub fn parse(self, entry: DirEntry) -> Result<Stats>
[src]
pub fn parse(self, entry: DirEntry) -> Result<Stats>
Parses a given DirEntry
using the LanguageType
. Returning Stats
on success.
pub fn parse_from_str(self, entry: DirEntry, text: &str) -> Result<Stats>
[src]
pub fn parse_from_str(self, entry: DirEntry, text: &str) -> Result<Stats>
Parses the text provided. Returning Stats
on success.
Trait Implementations
impl Clone for LanguageType
[src]
impl Clone for LanguageType
fn clone(&self) -> LanguageType
[src]
fn clone(&self) -> LanguageType
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)
Performs copy-assignment from source
. Read more
impl Copy for LanguageType
[src]
impl Copy for LanguageType
impl Debug for LanguageType
[src]
impl Debug for LanguageType
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 Eq for LanguageType
[src]
impl Eq for LanguageType
impl Ord for LanguageType
[src]
impl Ord for LanguageType
fn cmp(&self, other: &LanguageType) -> Ordering
[src]
fn cmp(&self, other: &LanguageType) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialEq for LanguageType
[src]
impl PartialEq for LanguageType
fn eq(&self, other: &LanguageType) -> bool
[src]
fn eq(&self, other: &LanguageType) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl PartialOrd for LanguageType
[src]
impl PartialOrd for LanguageType
fn partial_cmp(&self, other: &LanguageType) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &LanguageType) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
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]
impl FromStr for LanguageType
type Err = &'static str
The associated error which can be returned from parsing.
fn from_str(from: &str) -> Result<Self, Self::Err>
[src]
fn from_str(from: &str) -> Result<Self, Self::Err>
Parses a string s
to return a value of this type. Read more
impl Display for LanguageType
[src]
impl Display for LanguageType
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<'a> From<LanguageType> for Cow<'a, LanguageType>
[src]
impl<'a> From<LanguageType> for Cow<'a, LanguageType>
fn from(from: LanguageType) -> Self
[src]
fn from(from: LanguageType) -> Self
Performs the conversion.
impl<'a> From<&'a LanguageType> for Cow<'a, LanguageType>
[src]
impl<'a> From<&'a LanguageType> for Cow<'a, LanguageType>
fn from(from: &'a LanguageType) -> Self
[src]
fn from(from: &'a LanguageType) -> Self
Performs the conversion.
Auto Trait Implementations
impl Send for LanguageType
impl Send for LanguageType
impl Sync for LanguageType
impl Sync for LanguageType