pub trait SourceAdapter: Sync {
// Required methods
fn name(&self) -> &'static str;
fn language(&self) -> SourceLanguage;
fn extract(&self, source: &str, file: &SourceFile) -> Result<Extraction>;
// Provided method
fn extract_file(&self, file: &SourceFile) -> Result<Extraction> { ... }
}Expand description
Converts one supported definition-source language into the shared definition IR.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable adapter name used in diagnostics and registry inspection.
Sourcefn language(&self) -> SourceLanguage
fn language(&self) -> SourceLanguage
Parser language produced by this adapter registration.
Sourcefn extract(&self, source: &str, file: &SourceFile) -> Result<Extraction>
fn extract(&self, source: &str, file: &SourceFile) -> Result<Extraction>
Extracts definitions from in-memory source using file for source locations.
Provided Methods§
Sourcefn extract_file(&self, file: &SourceFile) -> Result<Extraction>
fn extract_file(&self, file: &SourceFile) -> Result<Extraction>
Reads and extracts one source file.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".