Skip to main content

Module plugin

Module plugin 

Source
Expand description

Per-backend plugin trait — the U2 seam.

Backend is the single, object-safe trait that a backend module implements to declare its identity, capabilities, and (in later steps) its generation and executor factories. The all_plugins() registry is the one place where backends are enumerated; everything else iterates that list.

Per §9.1 the executor returned by a plugin must be a stateless leaf I/O adapter — replica routing, cache, encryption, channels, and circuit breakers stay in DataBrokerRuntime orchestration, not in this trait.

§Object safety

All trait methods are &self and return owned values or sized types, so &dyn Backend and Box<dyn Backend> both work. The plugin structs in backend::plugins::* are zero-sized, so each has a pub static instance and the registry is a slice of 'static references.

The trait currently covers identity + capability + DSN scheme methods, with defaults that delegate to BackendKind. Generation and executor hooks can be added behind this same seam when those call sites are folded into the plugin inventory.

Structs§

BackendConformanceReport
Result of validating one plugin against the stable contract.
BackendPluginContract
Machine-readable contract for adding or validating a backend plugin.
BackendPluginSurface
One stable surface a backend plugin must provide.
RegisterCtx
Mutable context passed to Backend::register.

Enums§

BackendSupportState
Runtime implementation state for a known backend token.

Traits§

Backend
A plugin module describing one backend.

Functions§

all_plugins
All compiled-in backend plugins, in canonical order.
has_runtime_implementation
Backends that have a runtime implementation in this source tree.
plugin_for
Find a plugin by canonical token (alias of BackendKind::from_token).
plugin_for_kind
Find a compiled runtime plugin by parsed backend kind.
support_state_for_kind
Implementation state for a parsed backend kind.
support_state_for_token
Implementation state for a backend token or alias.