Skip to main content

emit

Function emit 

Source
pub fn emit(
    module: &PioModule<MulticonductorNetwork>,
    format: DistTargetFormat,
    destination: Destination,
) -> Result<EmitResult, Error>
Expand description

Emit a parsed module to format through a destination.

The JSON and CIM targets commit a single artifact — a path destination names the exact file, a memory destination names the artifact. The dss target is a directory inventory: the destination names the output root, the case text commits as case.dss, and every companion file the emitter produced (OpenDSS Buscoords CSV) commits beside it, so nothing the case text refers to is missing from the output. GridLAB-D targets also write directory inventories. Unchanged modules replay every acquired buffer under its original relative path, preserving the entrypoint location and includes. Absolute includes cannot be relocated byte exactly and are refused. Fresh, edited, IR-restored and cross-profile modules write canonical case.glm; crate::glm::emit_canonical directly writes a single file from a network value. An unchanged multi-file DSS project retains the paths and bytes of every acquired file, dependencies and companions alike, beneath source/; case.dss redirects to its entry file. A remark (EMIT.DSS.PROJECT_COMPANION_KEPT) names the companions, the supplied files the deck never read.

§Errors

Unsupported electrical features, nonportable retained projects, or the destination’s own collision and staging failures.

§Panics

Never on external input: the fixed artifact names are valid by construction.