Skip to main content

Module traits

Module traits 

Source
Expand description

The two contract traits: the client-facing call builder/parser and the node-facing handler.

  • ControlCall binds a typed params struct to its ControlMethod and its typed result — so a caller writes client.request(&SetCapParams { cap_bytes }) and gets back a SetCapResult, never a stringly-typed Value.
  • ControlClient is what a CLIENT depends on: build a JSON-RPC request from a typed call, and parse a response back into the typed result (or a ControlError). Pure — no transport; the consumer carries the bytes over dig-ipc / loopback-mTLS itself.
  • ControlHandler is what a NODE implements to SERVE the surface: one typed method per control method, plus a provided dispatch that routes a raw request to the right method — the single anti-drift seam the conformance KATs exercise.

Structs§

DefaultControlClient
The standard, zero-configuration ControlClient using the default request/response behaviour.

Traits§

ControlCall
A typed control call: a params struct that knows its ControlMethod and its result type.
ControlClient
The client-facing half of the contract: turn typed calls into requests and responses back into typed results.
ControlHandler
The node-facing half of the contract: a running node implements this to SERVE the control surface. Each method is typed to the catalog’s params/results; the provided dispatch routes a raw JsonRpcRequest to the right method so a server needs only one entry point and can never mis-route.

Functions§

build_request
Build the JSON-RPC request envelope for a typed control call. Pure.
parse_response
Parse a JSON-RPC response into a typed result, or the ControlError it carried. Pure.