Expand description
sui-daemon-client — typed multiplexed client for the graph-server.
§Use
use sui_daemon_client::DaemonClient;
use std::path::Path;
let client = DaemonClient::connect(Path::new("/run/sui/graph.sock")).await?;
let pong = client.ping().await?;
println!("daemon uptime: {}s", pong.uptime_seconds);§Behavior contract
- One
DaemonClientowns one openUnixStream. - Requests are multiplexed by
sui_protocol::RequestId. A client may have many in-flight requests on the same connection — responses are routed back via an internalHashMap<RequestId, oneshot::Sender>. - The connection is split into a reader task and a writer task on construction; both terminate when the client drops or the peer closes the socket.
- Errors are typed via
ClientError. Transport failures close the connection; per-request errors (from the server) come back asClientError::Serverwith the typedsui_protocol::ErrorCode.
§Reuse surface
- sui CLI —
sui flake show/sui evalconsult the daemon for warm-cache hits. - tend prebuild — pushes built closures into the daemon’s GraphStore.
- tests across the workspace — drive the daemon end-to-end without touching system sockets.
Structs§
- Daemon
Client - Typed multiplexed client for the graph-server.
- Ping
Pong - Typed ping response.