Expand description
C ABI type definitions for the Palladium plugin system.
This crate is intentionally dependency-free. All types are #[repr(C)]
and safe to expose across shared library (cdylib) and WASM boundaries.
Plugin authors implement the required C exports; the engine host reads plugin metadata and calls actor lifecycle functions through these types.
§Required exports (every plugin shared library)
PdPluginInfo* pd_plugin_init(void);
void pd_plugin_shutdown(void);
void* pd_actor_create (const char* type_name, uint32_t type_name_len,
const uint8_t* config, uint32_t config_len);
void pd_actor_destroy(void* actor);
int32_t pd_actor_on_start (void* actor, PdActorContext* ctx);
int32_t pd_actor_on_message(void* actor, PdActorContext* ctx,
const uint8_t* envelope_bytes,
const uint8_t* payload, uint32_t payload_len);
void pd_actor_on_stop (void* actor, PdActorContext* ctx, int32_t reason);Structs§
- PdActor
Context - Per-call context passed to every plugin actor lifecycle hook.
- PdActor
Type Info - Metadata for a single actor type exported by a plugin.
- PdEnvelope
- Fixed-size C-compatible message header passed to plugin lifecycle hooks.
- PdHost
Vtable - Engine capabilities made available to plugin actors during lifecycle calls.
- PdPlugin
Info - Top-level plugin metadata returned by the
pd_plugin_initexport.
Enums§
- PdError
- Return codes for plugin actor lifecycle functions.
Constants§
- ENVELOPE_
SIZE - Expected byte size of
PdEnvelope(matchespalladium_actor::Envelope::SIZE). - FLAG_
PRIORITY_ MASK - Mask for the 2-bit priority field (bits 1–2); higher value = higher priority.
- FLAG_
RESPONSE - Flag bit: this message is a response to a previous request.
- PD_
ABI_ VERSION - ABI version that every plugin and the engine must agree on at load time.