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§
- Backend
Conformance Report - Result of validating one plugin against the stable contract.
- Backend
Plugin Contract - Machine-readable contract for adding or validating a backend plugin.
- Backend
Plugin Surface - One stable surface a backend plugin must provide.
- Register
Ctx - Mutable context passed to
Backend::register.
Enums§
- Backend
Support State - 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.