pub struct LanguageTable { /* private fields */ }Expand description
Every language provider in reach, and the questions an app assembly asks of them.
Implementations§
Source§impl LanguageTable
impl LanguageTable
Sourcepub fn new(providers: Vec<LanguageProvider>) -> Result<Self, String>
pub fn new(providers: Vec<LanguageProvider>) -> Result<Self, String>
A table over providers. A module listed twice keeps its first entry.
§Errors
Two different languages both claim to be the default, or two languages claim one extension.
Sourcepub fn discover(lib_dir: Option<&Path>) -> Result<Self, String>
pub fn discover(lib_dir: Option<&Path>) -> Result<Self, String>
The descriptors in reach of this process: modules/<name>/ under
lib_dir, beside the running executable, beside the shared engine
library, and under LUMEN_LIB_DIR; then the ones the modules linked
into this binary registered; then the crates under std/ of the source
checkout this crate was built in, when that checkout is still on disk.
The first descriptor found for a module is the one read.
§Errors
A descriptor does not parse, or the descriptors disagree (see
Self::new).
Sourcepub fn providers(&self) -> &[LanguageProvider]
pub fn providers(&self) -> &[LanguageProvider]
Every provider, in the order they were found.
Sourcepub fn language_of(&self, path: &Path) -> Option<&str>
pub fn language_of(&self, path: &Path) -> Option<&str>
The language a script file belongs to, read off its extension.
Sourcepub fn default_language(&self) -> Option<&str>
pub fn default_language(&self) -> Option<&str>
The language an inline <script> block is read as.
Sourcepub fn extensions(&self) -> Vec<&str>
pub fn extensions(&self) -> Vec<&str>
Every extension a language owns.
Sourcepub fn source_provider(&self, language: &str) -> Option<&LanguageProvider>
pub fn source_provider(&self, language: &str) -> Option<&LanguageProvider>
The provider that runs language from source: the edit loop’s, which
can check, compile, and reload a program.
Sourcepub fn shipped_provider(&self, language: &str) -> Option<&LanguageProvider>
pub fn shipped_provider(&self, language: &str) -> Option<&LanguageProvider>
The provider a shipped app runs language with: the bytecode one when
the language has one, the source one otherwise.
Trait Implementations§
Source§impl Clone for LanguageTable
impl Clone for LanguageTable
Source§fn clone(&self) -> LanguageTable
fn clone(&self) -> LanguageTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LanguageTable
impl Debug for LanguageTable
Source§impl Default for LanguageTable
impl Default for LanguageTable
Source§fn default() -> LanguageTable
fn default() -> LanguageTable
Source§impl PartialEq for LanguageTable
impl PartialEq for LanguageTable
Source§fn eq(&self, other: &LanguageTable) -> bool
fn eq(&self, other: &LanguageTable) -> bool
self and other values to be equal, and is used by ==.impl Eq for LanguageTable
impl StructuralPartialEq for LanguageTable
Auto Trait Implementations§
impl Freeze for LanguageTable
impl RefUnwindSafe for LanguageTable
impl Send for LanguageTable
impl Sync for LanguageTable
impl Unpin for LanguageTable
impl UnsafeUnpin for LanguageTable
impl UnwindSafe for LanguageTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.