pub trait Emitter {
// Required methods
fn target(&self) -> Target;
fn emit(&self, model: &ExportModel) -> Result<ExportArtifacts>;
}Expand description
Transpiles an ExportModel into the files of a single deployment target.
Implementations live in their own modules: crate::ComposeEmitter,
crate::KubernetesEmitter, and crate::HelmEmitter.
§Determinism requirement
Emitters must produce deterministic output. Container environment maps are unordered, so any map-derived output must be sorted by key before it is written - otherwise golden-file tests become flaky.
§Example
use lightshuttle_export::{Emitter, ComposeEmitter, Target};
let emitter = ComposeEmitter;
assert_eq!(emitter.target(), Target::Compose);Required Methods§
Sourcefn emit(&self, model: &ExportModel) -> Result<ExportArtifacts>
fn emit(&self, model: &ExportModel) -> Result<ExportArtifacts>
Transpiles model into a set of named files for the emitter’s target.
§Errors
Returns crate::ExportError::Unsupported when a resource in model
cannot be represented for this target (for example, a locally built
image referenced by a Kubernetes manifest).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".