Skip to main content

Module template

Module template 

Source
Expand description

DCS/PLC template semantics: one instance per control-system convention (Yokogawa, Honeywell, etc.), describing how that DCS expresses PID parameters and the OPC item-name suffix convention used to derive a full tag set from a single PV tag (see crate::tags::derive_tag).

The built-in templates are not hardcoded Rust – they are parsed from an embedded TOML catalog (templates/builtin.toml), so adding support for a new DCS/PLC family is a data file change, not a Rust change. See AGENTS.md’s “Community DCS/PLC template catalog” section for the full design and contribution rationale.

Structs§

DcsTemplate
One DCS/PLC vendor’s conventions.

Enums§

TemplateError
Why DcsTemplate::validate or parse_catalog rejected a template.

Functions§

built_in_templates
The DCS/PLC templates shipped by default, parsed from the embedded catalog.
parse_catalog
Parses a TOML catalog (the [[template]] array-of-tables format used by templates/builtin.toml and the user catalog file bhtune-cli auto-loads) and validates every template it contains. Pure – takes an in-memory string and does no I/O itself; all file reading is the caller’s job (bhtune-cli’s template-user-catalog/ template-cli), keeping this crate’s “no I/O” rule intact.
to_catalog_toml
Serializes templates as a TOML catalog in the exact [[template]] array-of-tables shape parse_catalog reads back – the inverse operation. Used by bhtune-cli’s template export --format toml (a single template exports as a one-entry catalog) so the contribution loop is export -> annotate -> PR with no hand-transcription step. Pure, like parse_catalog: writing the result to a file is the caller’s job.