Skip to main content

Module dial

Module dial 

Source
Expand description

The dial() factory: the single place transport choice is made.

Today transport selection leaks into generated client code, which hardcodes ZmqConnection::new(...). Per the A1 addressing spike, that decision belongs in exactly one place: dial takes a resolved TransportConfig and returns a ready Arc<dyn RpcClient>, erasing the concrete transport behind the object-safe client trait (Transport itself is not object-safe — it has Sub/Pub associated types — so erasure happens at the RpcClient layer).

§Inproc dial table

inproc:// names resolve through a process-local registry mapping a name to a co-located service’s IrohRequestProcessor. The registry — not the TransportConfig — holds the live handle: a TransportConfig is Clone + Eq and wire-publishable (DiscoveryService), so an Arc<dyn IrohRequestProcessor> cannot live inside it. Naming (resolver → TransportConfig) and handles (registry → processor) stay separate; dial() is where they meet.

§Construction is synchronous; transports connect lazily

dial() is sync and does no I/O — the inproc arm only looks up an existing processor. Networked transports (quinn/iroh/moq) connect lazily on first send() (cached like ZmqConnection), so dialing never blocks and the inventory-registered sync factory pattern is preserved. Those arms land in a follow-up increment of #151(a); ZMQ ipc/systemd endpoints stay on the existing codegen path during the transition.

Enums§

MoqStreamSession
A dialed moq streaming session, erased over the concrete transport.

Constants§

MOQ_PATH
The URL path the daemon’s web_transport_quinn server dispatches to the moq streaming plane (default path → RPC). Both server and client use this.
NINEP_PATH
The URL path the daemon’s web_transport_quinn server dispatches to the 9P export plane (H1b / #765): the QUIC path-mux sibling of H1a’s /9p axum WebSocket endpoint, for the cert-pinned self-signed mesh. A WebTransport session whose CONNECT URL path is this is handed to the injected 9P handler (see crate::transport::quinn_transport); the mount ticket rides Tattach.uname, not the URL, since the session is already cert-pinned.

Functions§

dial
Dial a resolved TransportConfig, returning a ready RPC client.
dial_stream
Dial the moq streaming plane for a network-routable reach, returning a live [web_transport_quinn::Session] (#274).
dial_stream_authenticated
#1027: dial the moq streaming plane over iroh moql and run the inside-carrier admission challenge/response (crate::transport::moql_admission) BEFORE returning the session. The returned session is admitted: the server has verified the proof against its current accepted Ed25519 + ML-DSA-65 state and scoped the session to the resolved tenant.
dial_with_crypto_stores
Dial with both request-confidentiality and response-authentication anchors. Network response confidentiality requires both stores; absence remains a fail-closed runtime error at the shared client chokepoint.
dial_with_crypto_stores_and_token_provider
The provider form of the crypto-bound dial. A missing JWT remains missing; this API does not manufacture clearance from the caller’s signing key.
dial_with_kem_store
Dial with an anchored #mesh-kem recipient trust store for carriers that forbid cleartext request envelopes.
dial_with_token_provider
Dial with a JWT provider evaluated for each request, so long-lived clients observe credential renewal without rebuilding their transport.
lookup_inproc
Look up a co-located service’s processor by inproc name, upgrading the Weak. A stale (dead-service) entry is pruned in passing.
register_inproc
Register a co-located service’s request processor under an inproc:// name.
unregister_inproc
Explicitly drop a name’s registration (best-effort; dead entries also self-evict on lookup once the service’s strong Arc is gone).