Skip to main content

emit

Function emit 

Source
pub fn emit(
    specs: &[&MessageSpec],
    flavor: Flavor,
    schemas_version: &str,
    has_common: bool,
) -> Result<String, EmitError>
Expand description

Emit a mod.rs that declares one pub mod per active spec, sorted alphabetically by snake-case module name.

Pass only the specs whose wrapper files actually exist, which is the set that covers all active schemas. If has_common is true, this function also emits a pub mod common; entry.

ยงErrors

Returns an error when the generated code is not valid Rust, which is an emitter bug.