Skip to main content

LanguageAdapter

Trait LanguageAdapter 

Source
pub trait LanguageAdapter: Send + Sync {
    // Required methods
    fn language(&self) -> Language;
    fn extensions(&self) -> &'static [&'static str];
    fn extractor(&self) -> &'static str;
    fn parse(&self, source: SourceFile<'_>) -> Result<FileFacts>;
}

Required Methods§

Source

fn language(&self) -> Language

Source

fn extensions(&self) -> &'static [&'static str]

Source

fn extractor(&self) -> &'static str

Source

fn parse(&self, source: SourceFile<'_>) -> Result<FileFacts>

Parses one source file into language-neutral facts.

§Errors

Returns an error when the adapter itself cannot initialize or maintain its parser contract. Recoverable source syntax errors are diagnostics.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§