Skip to main content

Compiler

Trait Compiler 

Source
pub trait Compiler: Sized {
    type Configuration;
    type Error: Error + Send + Sync + 'static;
    type Output;

    // Required methods
    fn build(
        config: Self::Configuration,
    ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send;
    fn output_path(
        config: &Self::Configuration,
    ) -> impl Future<Output = Result<PathBuf, Self::Error>> + Send;
}
Expand description

Unified async compilation trait for firmware, application, and OP-TEE targets.

Each implementor owns its Configuration type (carries all build parameters), a typed Error, and an Output (usually PathBuf to the built artifact).

The trait methods are free functions (take config by value or reference) so callers can use any implementor with the same .build(cfg) / .output_path(&cfg) UX.

Required Associated Types§

Source

type Configuration

All build parameters for this compiler.

Source

type Error: Error + Send + Sync + 'static

Typed error returned from build operations.

Source

type Output

The primary artifact produced (usually PathBuf).

Required Methods§

Source

fn build( config: Self::Configuration, ) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send

Run the full build and return the path to the primary artifact.

Source

fn output_path( config: &Self::Configuration, ) -> impl Future<Output = Result<PathBuf, Self::Error>> + Send

Return the expected output path without building.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§