pub enum Language {
Show 21 variants
Rust,
Python,
JavaScript,
TypeScript,
Tsx,
Go,
Java,
C,
Cpp,
CSharp,
Ruby,
Php,
Kotlin,
Scala,
Swift,
OCaml,
Solidity,
Lua,
Zig,
Elisp,
Unknown,
}Variants§
Rust
Python
JavaScript
TypeScript
Tsx
Go
Java
C
Cpp
CSharp
Ruby
Php
Kotlin
Scala
Swift
OCaml
Solidity
Lua
Zig
Elisp
Unknown
Implementations§
Source§impl Language
impl Language
Sourcepub const ALL: &'static [Self]
pub const ALL: &'static [Self]
Every language semtree can parse, in a stable order. Unknown is not a
language, so it is absent; use it to build help text and error messages.
pub fn from_extension(ext: &str) -> Self
pub fn from_path(path: &Path) -> Self
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Parse a user-facing language name, as accepted by a --lang filter.
Case-insensitive, and takes the common short forms (rs, py, ts)
alongside the canonical name Display prints.
Returns None for anything unrecognized so a caller can report a typo
rather than silently filtering everything out.
Trait Implementations§
impl Copy for Language
Source§impl<'de> Deserialize<'de> for Language
impl<'de> Deserialize<'de> for Language
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Language
Source§impl Ord for Language
impl Ord for Language
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Language
impl PartialOrd 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 UnsafeUnpin 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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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.