pub trait Backend: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn targets(&self) -> &[Target];
fn lower(
&self,
module: &Module,
config: &BackendConfig,
) -> Result<Artifact, BackendError>;
}Expand description
Code-lane emission trait. See docs/specifications/sub/backend-trait.md.
Required Methods§
Sourcefn targets(&self) -> &[Target]
fn targets(&self) -> &[Target]
Targets this backend can emit. Each Target variant is
owned by exactly one Backend impl (target_ownership invariant).
Sourcefn lower(
&self,
module: &Module,
config: &BackendConfig,
) -> Result<Artifact, BackendError>
fn lower( &self, module: &Module, config: &BackendConfig, ) -> Result<Artifact, BackendError>
Lower a meta-HIR module under the given config to an Artifact.
Invariants: deterministic per (module, config); frame-pure
(no mutation of inputs); every target-specific IR construct
in Artifact.primary cited via Artifact.citations.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".