pub enum Language {
Show 40 variants
Rust,
C,
Cpp,
Go,
Zig,
JavaScript,
TypeScript,
HTML,
CSS,
SCSS,
SASS,
Python,
Java,
CSharp,
Kotlin,
Scala,
Ruby,
PHP,
Haskell,
OCaml,
FSharp,
Erlang,
Elixir,
Clojure,
JSON,
YAML,
TOML,
XML,
Markdown,
SQL,
Bash,
PowerShell,
Batch,
R,
Julia,
Matlab,
Swift,
ObjectiveC,
Dart,
Unknown,
}Expand description
Programming language classification
Variants§
Rust
C
Cpp
Go
Zig
JavaScript
TypeScript
HTML
CSS
SCSS
SASS
Python
Java
CSharp
Kotlin
Scala
Ruby
PHP
Haskell
OCaml
FSharp
Erlang
Elixir
Clojure
JSON
YAML
TOML
XML
Markdown
SQL
Bash
PowerShell
Batch
R
Julia
Matlab
Swift
ObjectiveC
Dart
Unknown
Implementations§
Source§impl Language
impl Language
Sourcepub fn from_extension(ext: &str) -> Language
pub fn from_extension(ext: &str) -> Language
Detect language from file extension
Sourcepub fn is_documentation(&self) -> bool
pub fn is_documentation(&self) -> bool
Check if this language is typically used for documentation
Sourcepub fn is_configuration(&self) -> bool
pub fn is_configuration(&self) -> bool
Check if this language is typically used for configuration
Sourcepub fn is_programming(&self) -> bool
pub fn is_programming(&self) -> bool
Check if this is a programming language (not markup/config)
Sourcepub fn display_name(&self) -> &'static str
pub fn display_name(&self) -> &'static str
Display name used for user-facing messaging
Sourcepub fn extensions(&self) -> &'static [&'static str]
pub fn extensions(&self) -> &'static [&'static str]
Get the typical file extensions for this language
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Language
impl<'de> Deserialize<'de> for Language
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Language, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Language, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Language
impl Ord for Language
Source§impl PartialOrd for Language
impl PartialOrd for Language
Source§impl Serialize for Language
impl Serialize for Language
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more