Skip to main content

Backend

Trait Backend 

Source
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§

Source

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

Human-readable backend name, e.g. “rust”, “ptx”, “wgsl”.

Source

fn targets(&self) -> &[Target]

Targets this backend can emit. Each Target variant is owned by exactly one Backend impl (target_ownership invariant).

Source

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".

Implementors§