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§
Sourcetype Configuration
type Configuration
All build parameters for this compiler.
Required Methods§
Sourcefn build(
config: Self::Configuration,
) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send
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.
Sourcefn output_path(
config: &Self::Configuration,
) -> impl Future<Output = Result<PathBuf, Self::Error>> + Send
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".