Skip to main content

LanguageProcessor

Trait LanguageProcessor 

Source
pub trait LanguageProcessor: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn extensions(&self) -> &[&str];
    fn parse(&self, source: &str, path: &Path) -> Result<FileInsight>;
}
Expand description

语言处理器 trait — 每个语言实现此 trait

必须 Send + Sync 以支持并行解析

Required Methods§

Source

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

Source

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

Source

fn parse(&self, source: &str, path: &Path) -> Result<FileInsight>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§