Trait foundry_compilers::compilers::ParsedSource

source ·
pub trait ParsedSource: Debug + Sized + Send {
    type Language: Language;

    // Required methods
    fn parse(content: &str, file: &Path) -> Result<Self>;
    fn version_req(&self) -> Option<&VersionReq>;
    fn resolve_imports<C>(
        &self,
        paths: &ProjectPathsConfig<C>
    ) -> Result<Vec<PathBuf>>;
    fn language(&self) -> Self::Language;
}
Expand description

Parser of the source files which is used to identify imports and version requirements of the given source. Used by path resolver to resolve imports or determine compiler versions needed to compiler given sources.

Required Associated Types§

Required Methods§

source

fn parse(content: &str, file: &Path) -> Result<Self>

source

fn version_req(&self) -> Option<&VersionReq>

source

fn resolve_imports<C>( &self, paths: &ProjectPathsConfig<C> ) -> Result<Vec<PathBuf>>

source

fn language(&self) -> Self::Language

Object Safety§

This trait is not object safe.

Implementors§