pub trait SourcePlugin: Sync {
// Required methods
fn flavor(&self) -> SourceFlavor;
fn extensions(&self) -> &'static [&'static str];
fn import_syntax(&self) -> FrontendImportSyntax;
fn parse_source(&self, source: &str) -> Result<FrontendIr, ParseError>;
// Provided methods
fn parser_dialect(&self) -> Option<&'static dyn ParserDialect> { ... }
fn parse_module_imports(
&self,
_source: &str,
_path: &Path,
) -> Result<Vec<ModuleImport>, SourcePathError> { ... }
fn strip_import_directives(&self, source: &str) -> String { ... }
}Required Methods§
fn flavor(&self) -> SourceFlavor
fn extensions(&self) -> &'static [&'static str]
fn import_syntax(&self) -> FrontendImportSyntax
fn parse_source(&self, source: &str) -> Result<FrontendIr, ParseError>
Provided Methods§
fn parser_dialect(&self) -> Option<&'static dyn ParserDialect>
fn parse_module_imports( &self, _source: &str, _path: &Path, ) -> Result<Vec<ModuleImport>, SourcePathError>
fn strip_import_directives(&self, source: &str) -> String
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".