Expand description
Client side: connect to the project’s daemon, spawning it on first use.
Functions§
- request
- Send one request and collect the whole response into a
Vec(for small responses). - request_
existing - Like
requestbut never spawns — returnsNoneif no daemon is listening. Forstop/status. - request_
stream - Send one request to the daemon for
root(spawning it if needed), streaming the response tosink. Returns the total number of bytes written. - spawn_
daemon - Spawn a detached background daemon (
rgx --server) rooted atroot. - store_
cursor - Park a pagination cursor blob in
root’s daemon (spawning it if needed); returns the short token to print in place of the blob. - take_
cursor - Redeem a pagination token at
root’s daemon.Ok(None)means it expired or was already used — the daemon replies with an empty frame, or there’s no daemon at all (so no stored cursors). Uses a connect-only request: a stale token must never spawn a fresh daemon (and a cold index build) just to discover it’s gone. - wait_
until_ stopped - Poll until no daemon is listening for
root, up to ~5s. Used byrestartafter a Shutdown so the fresh daemon isn’t spawned while the old one still holds the endpoint (it would exit as a no-op). Returnstrueonce the endpoint is free,falseon timeout. - watch
- Subscribe to the daemon’s live status (spawning it if needed), invoking
renderwith each status frame as it arrives, until the daemon closes the stream (or the process is interrupted).