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§
Sourcefn primary_target(&self) -> CompilationTarget
fn primary_target(&self) -> CompilationTarget
Get the primary compilation target supported by this backend.
Sourcefn artifact_type(&self) -> ArtifactType
fn artifact_type(&self) -> ArtifactType
Get the type of artifact generated by this backend.
Sourcefn match_score(&self, target: &CompilationTarget) -> f32
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.
Sourcefn generate(
&self,
program: &GaiaModule,
config: &GaiaConfig,
) -> Result<GeneratedFiles>
fn generate( &self, program: &GaiaModule, config: &GaiaConfig, ) -> Result<GeneratedFiles>
Compile Gaia program to target platform
Implementors§
impl Backend for ClrBackend
Available on crate feature
clr-assembler only.