Skip to main content

Module adapter

Module adapter 

Source
Expand description

Adapter traits: the tiered interface that database/protocol drivers implement (SRD 38).

The tiered interface separates init-time template analysis from cycle-time execution:

  • DriverAdapter::map_op() — called once per template at activity startup
  • OpDispenser::execute() — called per-cycle to bind values and execute

Re-exports§

pub use crate::fixture::ExecCtx;

Structs§

AdapterError
Error from an adapter operation.
AdapterRegistration
An adapter module’s registration, submitted at link time via inventory.
BinderSlot
One slot in a binder.
CaptureDecl
Capture point declaration in an op template.
DriverImpl
One driver implementation registered for an adapter.
JsonBody
JSON result body. Adapters that natively produce JSON (HTTP/REST endpoints, the Jolokia JMX bridge, JSON-RPC) wrap the parsed value here so verify: field assertions and result-binding extractors can address nested keys (status, value, etc.) without a re-parse step.
KernelLookup
A kernel of any engine, as a scope names resolve in.
OpResult
The result of a successful operation.
ResolvedFields
Resolved field values for a single cycle. Produced by the GK synthesis pipeline, consumed by the OpDispenser.
SharedDriverRegistration
SRD-35 Push B: declares that a (adapter, driver) pair supports pool-shared instances. Drivers that submit one of these opt into the resource pool’s Shared policy path: instead of a fresh Arc<dyn DriverAdapter> per phase, the pool caches the adapter under Self::resource_key and reuses it across every phase whose params produce the same key.
StatusMetric
A metric to display on the activity status line.
TextBody
Simple text result body.

Enums§

Binder
One adapter-declared binding shape for one op-template field.
DisplayPreference
Adapter display preference for TUI activation.
ExecutionError
Execution error with scope delamination.
PortType
Compile-time type tag for a port on a Polydat node.
StatusRender
How to render a status metric value.

Constants§

DEFAULT_DRIVER_NAME
Pick a driver for adapter (user-supplied selector or default ranking) and instantiate it.

Traits§

DriverAdapter
A protocol-specific driver adapter. Constructed once per activity, shared across fibers via Arc.
Kernel
One kernel API for every engine, and the one error a write to a declared slot can fail with. WriteError sits beside KernelError at the root because they are the pair a host handles: one for building a kernel, one for writing to it. A kernel on any engine: the interpreter, the closure tier, the hybrid kernel, or pure native code. Every engine accepts every program the interpreter accepts, or refuses it at construction with a reason, and computes the same values for the same inputs; the choice of engine changes how fast a program runs and nothing else. This trait is the surface a host drives an engine through without knowing which one it has.
Lookup
Name resolution for comprehension sources and predicates: what a {name} placeholder or a bare identifier reads. The interpreter kernel is one; a Layered view puts a tuple’s bindings in front of another, so opening a traversal needs no kernel of the engine that opens it (engines.md §3.6).
OpDispenser
A per-template op factory. Created at init time by the adapter’s map_op(), called per-cycle to bind values and execute operations.
ResultBody
Trait for adapter-specific result bodies.
WrappingDispenser
Marker trait for dispensers that wrap another OpDispenser. Implementing it is the type-level commitment that this layer has overridden OpDispenser::inner_dispenser to expose its inner dispenser. Without that override, cross-cutting machinery (describe(), adapter_metrics, status_counters) silently stops walking at the wrapper, which has been a real source of bugs.

Functions§

adapter_display_preference
Look up the display preference for a driver name without constructing the adapter.
adapter_driver_params
Union of every driver-specific known-param for adapter. Surfaced in CLI validation so unknown-param warnings don’t fire for driver-private knobs (e.g. CQL’s hosts, port, keyspace).
default_drivers
Default order of drivers registered for adapter, sorted by ascending DriverImpl::default_rank. Used as the fallback when the user doesn’t set the adapter’s driver-selector parameter.
find_adapter_registration
Look up an adapter by driver name from all link-time registrations.
find_driver
Find a driver implementation by (adapter, driver). Used by the runner to pick the right factory after resolving the driver-selector parameter.
find_shared_driver
Look up the shared registration for a (adapter, driver) pair. Returns None when the driver hasn’t migrated to the pool-shared shape — the executor falls back to the LegacyAdapterResource shim under PerPhase policy in that case.
instantiate_with_driver
registered_adapter_params
Collect all extra known params from registered adapters, unioned with driver-implementation–specific params contributed via DriverImpl entries (e.g. CQL’s hosts, port, keyspace, …) so they don’t trip the “unrecognized parameter” guard at the CLI layer.
registered_driver_names
List all registered driver names.
resolve_driver_name
Resolve the driver name for an (adapter, params) pair without instantiating anything. Used by the resource pool’s Push B path: the executor needs the resolved driver name to look up a SharedDriverRegistration before deciding which attach path to use. Mirrors the resolution logic in instantiate_with_driver — user-supplied selector first (comma-separated, in order), then the rank-sorted default list.
verify_binders
Verify typed binders against a kernel of any engine: each slot’s wire resolves as an output of the kernel’s program, else as an input (the coordinate / extern wires an op-template kernel declares). The engine-neutral form of polydat::binder::verify_against_kernel, which takes an interpreter kernel. Violation messages are joined with "; ".

Type Aliases§

CreateAdapterFuture
Boxed, Send future produced by an adapter/driver create factory — yields a connected DriverAdapter (or an error message).
MapOpFuture
Boxed, Send future returned by DriverAdapter::map_op — yields a boxed OpDispenser (or an error message). The lifetime ties the future to the borrowed &self / template references.