Expand description
Public Rust API and plugin SDK for Confium.
This crate is the bottom of the dependency stack. Everyone (core, store, registry, net, tc, plugin authors) can depend on it. It does not include the plugin loader itself.
It exposes the shared types that plugin authors need to write a Confium plugin in Rust without re-declaring the wire types:
- Opaque handle helpers (
OpaqueHandle) for boxing/unboxing Rust objects behind the type-erased*mut c_voidplugin contract. - Option map types (
OptionMap,OptionValue) used by thecfmp_<iface>_createfamily to pass string/u32/nested configuration from Confium to the plugin. - Error conversion (
PluginError,ErrorCode) — the canonical numeric codes returned through the FFI surface, plus aFromimpl so plugin authors can?their own errors into the wire code.
The proc-macros in confium-macros consume these types when generating
the cfmp_<iface>_* entry points and the cfmp_query_interfaces /
cfmp_metadata boilerplate. See TODO.roadmap/02-workspace-layout.md
and TODO.roadmap/03-plugin-contract.md for the design.
Re-exports§
pub use error::ErrorCode;pub use error::PluginError;pub use error::PluginResult;pub use handle::OpaqueHandle;pub use metadata::PluginMetadata;pub use metadata::PluginMetadataBuilder;pub use options::OptionMap;pub use options::OptionValue;pub use options::OptionView;pub use plugin::AeadPlugin;pub use plugin::CipherPlugin;pub use plugin::HashPlugin;pub use plugin::KdfPlugin;pub use plugin::KemPlugin;pub use plugin::KeyfmtPlugin;pub use plugin::RngPlugin;pub use plugin::SignaturePlugin;
Modules§
- error
- Error model exposed to plugin authors.
- handle
- Opaque handle helpers for boxing/unboxing Rust plugin state behind
the type-erased
*mut c_voidplugin contract. - metadata
- Plugin metadata exposed via the optional
cfmp_metadatasymbol. - options
- Option map types passed from Confium into a plugin’s
createentry point. - plugin
- Traits plugin authors implement for each Confium interface.
- registry
- Link-time registry of interfaces declared in a plugin crate.
Macros§
- register_
interface - Submit a
RegisteredInterfaceto the link-time registry. Thin wrapper aroundinventory::submit!so the#[plugin_interface]proc-macro can emit registrations throughconfium_apiwithout forcing every plugin crate to depend oninventorydirectly.