Skip to main content

Crate confium_api

Crate confium_api 

Source
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_void plugin contract.
  • Option map types (OptionMap, OptionValue) used by the cfmp_<iface>_create family 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 a From impl 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_void plugin contract.
metadata
Plugin metadata exposed via the optional cfmp_metadata symbol.
options
Option map types passed from Confium into a plugin’s create entry 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 RegisteredInterface to the link-time registry. Thin wrapper around inventory::submit! so the #[plugin_interface] proc-macro can emit registrations through confium_api without forcing every plugin crate to depend on inventory directly.