Skip to main content

emit

Function emit 

Source
pub fn emit<T>(
    module: &PioModule<T>,
    format: &str,
    output: impl IntoDestination,
) -> Result<EmitResult, Error>
where T: Clone + Into<PioValue>,
Expand description

Emit one module as format into output. The concrete value routes to its grid exchange format implementation. PowerIO IR uses crate::serialize instead.

output names the file or directory to write, or is a powerio_core::Destination, which is how a memory destination and its artifact root name are given.

§Errors

REQUEST.EMIT.UNKNOWN_FORMAT for a format name nothing recognizes, REQUEST.EMIT.UNSUPPORTED_VALUE_TYPE for a value the named format cannot state, and the family writer’s own failure otherwise.

§Panics

Never on external input: the fixed artifact names are valid by construction, and the solution columns a family writer reads are length checked by the solution constructors.