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§
fn name(&self) -> &'static str
fn extensions(&self) -> &[&str]
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".