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 startupOpDispenser::execute()— called per-cycle to bind values and execute
Re-exports§
pub use crate::fixture::ExecCtx;
Structs§
- Adapter
Error - Error from an adapter operation.
- Adapter
Registration - An adapter module’s registration, submitted at link time via
inventory. - Binder
Slot - One slot in a binder.
- Capture
Decl - Capture point declaration in an op template.
- Driver
Impl - One driver implementation registered for an adapter.
- Json
Body - 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. - Kernel
Lookup - A kernel of any engine, as a scope names resolve in.
- OpResult
- The result of a successful operation.
- Resolved
Fields - Resolved field values for a single cycle. Produced by the GK synthesis pipeline, consumed by the OpDispenser.
- Shared
Driver Registration - 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’sSharedpolicy path: instead of a freshArc<dyn DriverAdapter>per phase, the pool caches the adapter underSelf::resource_keyand reuses it across every phase whose params produce the same key. - Status
Metric - A metric to display on the activity status line.
- Text
Body - Simple text result body.
Enums§
- Binder
- One adapter-declared binding shape for one op-template field.
- Display
Preference - Adapter display preference for TUI activation.
- Execution
Error - Execution error with scope delamination.
- Port
Type - Compile-time type tag for a port on a Polydat node.
- Status
Render - 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§
- Driver
Adapter - 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.
WriteErrorsits besideKernelErrorat 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; aLayeredview 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. - Result
Body - Trait for adapter-specific result bodies.
- Wrapping
Dispenser - Marker trait for dispensers that wrap another
OpDispenser. Implementing it is the type-level commitment that this layer has overriddenOpDispenser::inner_dispenserto 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’shosts,port,keyspace). - default_
drivers - Default order of drivers registered for
adapter, sorted by ascendingDriverImpl::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. ReturnsNonewhen the driver hasn’t migrated to the pool-shared shape — the executor falls back to theLegacyAdapterResourceshim underPerPhasepolicy 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
DriverImplentries (e.g. CQL’shosts,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 aSharedDriverRegistrationbefore deciding which attach path to use. Mirrors the resolution logic ininstantiate_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§
- Create
Adapter Future - Boxed,
Sendfuture produced by an adapter/drivercreatefactory — yields a connectedDriverAdapter(or an error message). - MapOp
Future - Boxed,
Sendfuture returned byDriverAdapter::map_op— yields a boxedOpDispenser(or an error message). The lifetime ties the future to the borrowed&self/ template references.