Trait erg_compiler::artifact::Buildable

source ·
pub trait Buildable<T = HIR> {
    // Required methods
    fn inherit(cfg: ErgConfig, shared: SharedCompilerResource) -> Self
       where Self: Sized;
    fn inherit_with_name(
        cfg: ErgConfig,
        mod_name: Str,
        shared: SharedCompilerResource
    ) -> Self
       where Self: Sized;
    fn build(
        &mut self,
        src: String,
        mode: &str
    ) -> Result<CompleteArtifact<T>, IncompleteArtifact<T>>;
    fn build_from_ast(
        &mut self,
        ast: AST,
        mode: &str
    ) -> Result<CompleteArtifact<T>, IncompleteArtifact<T>>;
    fn pop_context(&mut self) -> Option<ModuleContext>;
    fn get_context(&self) -> Option<&ModuleContext>;
}

Required Methods§

source

fn inherit(cfg: ErgConfig, shared: SharedCompilerResource) -> Self
where Self: Sized,

source

fn inherit_with_name( cfg: ErgConfig, mod_name: Str, shared: SharedCompilerResource ) -> Self
where Self: Sized,

source

fn build( &mut self, src: String, mode: &str ) -> Result<CompleteArtifact<T>, IncompleteArtifact<T>>

source

fn build_from_ast( &mut self, ast: AST, mode: &str ) -> Result<CompleteArtifact<T>, IncompleteArtifact<T>>

source

fn pop_context(&mut self) -> Option<ModuleContext>

source

fn get_context(&self) -> Option<&ModuleContext>

Implementors§

source§

impl Buildable<TranspiledFile> for Transpiler

source§

impl<ASTBuilder: ASTBuildable> Buildable for GenericHIRBuilder<ASTBuilder>

source§

impl<ASTBuilder: ASTBuildable> Buildable for GenericASTLowerer<ASTBuilder>

source§

impl<ASTBuilder: ASTBuildable, HIRBuilder: Buildable> Buildable for GenericPackageBuilder<ASTBuilder, HIRBuilder>