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
version—AbiVersion,SchemaVersionRange,CompatibilityStatus, andcheck_compatibility(ABI/schema/capability negotiation).meta—PluginMeta,PluginCapability,PluginCapabilities.result—PluginComplianceStatus,PluginFinding,PluginResult,AbiResult(the call-outcome envelope).error—PluginError,PluginFieldError.plugin—DppSectorPlugin, the trait a plugin author implements, andPluginIdentity, the per-plugin fields its defaultmeta()uses.
Structs§
- AbiVersion
- ABI version declared by a plugin.
- Plugin
Capabilities - Full capability declaration returned by a plugin during negotiation.
- Plugin
Field Error - Structured error with field-level detail.
- Plugin
Finding - A single determination finding emitted by a plugin’s
calculate_metrics. - Plugin
Identity - The identity fields that genuinely vary per plugin — everything else in
PluginMeta(license,author,homepage) is a fixed Odal Node convention supplied by the defaultDppSectorPlugin::meta. - Plugin
Meta - Static metadata returned by a plugin.
- Plugin
Result - Compliance result returned by the plugin.
- Schema
Version Range - Schema version range a plugin supports.
Enums§
- AbiResult
- JSON envelope wrapping the outcome of a fallible plugin ABI call.
- Compatibility
Status - Result of a compatibility check between host and plugin.
- Plugin
Capability - Feature flags a plugin may declare support for.
- Plugin
Compliance Status - Typed compliance determination returned by a plugin.
- Plugin
Error
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§
- DppSector
Plugin - 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§
- Plugin
Input - Raw JSON input passed from the host to a plugin entry point.