Enum syntastica_parsers::Lang
source · #[non_exhaustive]pub enum Lang {
Show 27 variants
Asm,
C,
CSharp,
Comment,
Cpp,
Css,
Ebnf,
Ejs,
Erb,
Go,
Hexdump,
Java,
Javascript,
Json,
Lua,
Markdown,
MarkdownInline,
Ocaml,
OcamlInterface,
Python,
Regex,
Ruby,
Rush,
Rust,
Scala,
Toml,
Ursa,
}
Expand description
An enum of every supported language in the current feature set.
An instance of the respective tree-stter
Language
can be obtained with the
get
method.
You can also get a Lang
from its name using
for_name
, or for a
FileType
using
for_file_type
.
See the docs for each variant to see its “name” and the supported file types.
Both of these require the
SupportedLanguage
trait to be
in scope.
See LANGUAGES
for a list containing all variants and LANGUAGE_NAMES
for a list
of all valid names.
The enum is marked as non-exhaustive for two reasons:
- New languages may be added in the future
- The variants are enabled/disabled by features
Example
use syntastica_parsers::{Lang, LANGUAGES, LANGUAGE_NAMES};
use syntastica_core::language_set::{SupportedLanguage, FileType};
// you can get a `Lang` from its name
assert_eq!(Lang::Rust, Lang::for_name("rust").unwrap());
// and for a file type
assert_eq!(Some(Lang::Rust), Lang::for_file_type(FileType::Rust));
// `LANGUAGES` is a list of all variants,
// `LANGUAGE_NAMES` is a list of all variant names
for (&lang, &name) in LANGUAGES.iter().zip(LANGUAGE_NAMES) {
assert_eq!(lang, Lang::for_name(name).unwrap());
// `Lang` instances can be turned into strings
assert_eq!(lang, Lang::for_name(lang.name()).unwrap());
assert_eq!(lang, Lang::for_name(lang.to_string()).unwrap());
assert_eq!(lang, Lang::for_name(lang.as_ref()).unwrap());
let lang_name: &'static str = lang.into();
assert_eq!(lang, Lang::for_name(lang_name).unwrap());
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Asm
most
or asm
only.C
some
or c
only.CSharp
most
or c_sharp
only.Comment
most
or comment
only.Provides the comment
language, supports no file types.
Cpp
some
or cpp
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Css
some
or css
only.Ebnf
all
or ebnf
only.Ejs
all
or ejs
only.Provides the ejs
language, supports these file types: ejavascript
.
Erb
all
or erb
only.Go
some
or go
only.Hexdump
all
or hexdump
only.Java
some
or java
only.Javascript
some
or javascript
only.Provides the javascript
language, supports these file types: javascript
, jsx
.
Json
some
or json
only.Lua
some
or lua
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Markdown
most
or markdown
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.MarkdownInline
most
or markdown_inline
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Provides the markdown_inline
language, supports these file types: markdown
.
Ocaml
all
or ocaml
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.OcamlInterface
all
or ocaml_interface
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Provides the ocaml_interface
language, supports these file types: ocamlinterface
.
Python
some
or python
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Regex
most
or regex
only.Provides the regex
language, supports no file types.
Ruby
most
or ruby
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Rush
all
or rush
only.Rust
some
or rust
only.Scala
most
or scala
) and not (WebAssembly and target_vendor="unknown"
and target_os="unknown"
and target_env=""
) only.Toml
some
or toml
only.Ursa
all
or ursa
only.Implementations§
Trait Implementations§
source§impl PartialEq<Lang> for Lang
impl PartialEq<Lang> for Lang
source§impl SupportedLanguage for Lang
impl SupportedLanguage for Lang
impl Copy for Lang
impl Eq for Lang
impl StructuralEq for Lang
impl StructuralPartialEq for Lang
Auto Trait Implementations§
impl RefUnwindSafe for Lang
impl Send for Lang
impl Sync for Lang
impl Unpin for Lang
impl UnwindSafe for Lang
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere C: IntoArrays<T>,
source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere C: FromArrays<T>,
source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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
source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere C: IntoComponents<T>,
source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere U: IntoStimulus<T>,
source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere U: FromAngle<T>,
source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.source§impl<'a, T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<'a, T, C> TryComponentsInto<C> for Twhere C: TryFromComponents<T>,
§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more