Skip to main content

Crate dpp_plugin_traits

Crate dpp_plugin_traits 

Source
Expand description

Host/guest ABI contract for Odal Node sector plugins.

Plugins implement DppSectorPlugin and export the three entry points as extern "C" symbols. The host invokes them through the wasmtime component model or directly via the low-level ABI defined below.

Data crosses the host/guest boundary as JSON strings over a shared-memory slice, so the low-level ABI itself is just integer pointer/length pairs. (The crate uses std types — String, Vec, HashMap — so it is not no_std.)

§Versioning

Every plugin declares which ABI version and schema versions it supports via PluginCapabilities. The host uses this for compatibility checks before dispatching any calls.

§Module layout

Structs§

AbiVersion
ABI version declared by a plugin.
PluginCapabilities
Full capability declaration returned by a plugin during negotiation.
PluginFieldError
Structured error with field-level detail.
PluginFinding
A single determination finding emitted by a plugin’s calculate_metrics.
PluginMeta
Static metadata returned by a plugin.
PluginResult
Compliance result returned by the plugin.
SchemaVersionRange
Schema version range a plugin supports.

Enums§

AbiResult
JSON envelope wrapping the outcome of a fallible plugin ABI call.
CompatibilityStatus
Result of a compatibility check between host and plugin.
PluginCapability
Feature flags a plugin may declare support for.
PluginComplianceStatus
Typed compliance determination returned by a plugin.
PluginError

Constants§

ABI_VERSION_MAJOR
Current host ABI version.
ABI_VERSION_MINOR
METRIC_CO2E_SCORE
Well-known metric key for CO₂e score (kg CO₂e per functional unit).
METRIC_RECYCLED_CONTENT_PCT
Well-known metric key for recycled content percentage (0.0–100.0).
METRIC_REPAIRABILITY_INDEX
Well-known metric key for the repairability index (0.0–10.0; non-regulatory heuristic, not EN 45554 / EU 2023/1669).

Traits§

DppSectorPlugin
The entry points every sector plugin must export.

Functions§

check_compatibility
Check if a plugin is compatible with the current host and a requested schema version.

Type Aliases§

PluginInput
Raw JSON input passed from the host to a plugin entry point.