pub trait DynGenerator: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn generate(&self, api: &Api, out_dir: &Utf8Path) -> Result<()>;
fn output_files(&self, api: &Api, out_dir: &Utf8Path) -> Vec<String>;
fn config_hash_input(&self) -> Vec<u8> ⓘ;
}Expand description
Object-safe view of a Generator paired with a concrete config.
The orchestrator stores generators as &dyn DynGenerator so it can
hold a heterogeneous set of targets whose Config types differ.
ConfiguredGenerator is the canonical adapter.
Required Methods§
fn name(&self) -> &'static str
fn generate(&self, api: &Api, out_dir: &Utf8Path) -> Result<()>
fn output_files(&self, api: &Api, out_dir: &Utf8Path) -> Vec<String>
Sourcefn config_hash_input(&self) -> Vec<u8> ⓘ
fn config_hash_input(&self) -> Vec<u8> ⓘ
Canonical-JSON encoding of the bound config, fed into the cache hash so a config-only change invalidates the entry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".