Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    // Required methods
    fn name(&self) -> &'static str;
    fn primary_target(&self) -> CompilationTarget;
    fn artifact_type(&self) -> ArtifactType;
    fn match_score(&self, target: &CompilationTarget) -> f32;
    fn generate(
        &self,
        program: &GaiaModule,
        config: &GaiaConfig,
    ) -> Result<GeneratedFiles>;
}
Expand description

Backend compiler trait

Required Methods§

Source

fn name(&self) -> &'static str

Get backend name

Source

fn primary_target(&self) -> CompilationTarget

Get the primary compilation target supported by this backend.

Source

fn artifact_type(&self) -> ArtifactType

Get the type of artifact generated by this backend.

Source

fn match_score(&self, target: &CompilationTarget) -> f32

Calculate the match score (0-100) for the given compilation target. A score of 0 indicates that the target is not supported.

Source

fn generate( &self, program: &GaiaModule, config: &GaiaConfig, ) -> Result<GeneratedFiles>

Compile Gaia program to target platform

Implementors§