Sdk rust koder ipc

koder_ipc (Rust crate)

  • *rea:*Developer Platform
  • *ath:*engines/sdk/rust/koder_ipc
  • *ind:*Rust crate — KoderIPC binding for Rust applications
  • *ersion:*0.1.0

Role in the stack

Rust binding for the KoderIPC protocol. Enables Rustbased Koder applications and daemons to participate in interapp communication via JSON-RPC 2.0 over Unix sockets (Linux/macOS).

Built on Tokio async runtime for non-blocking I/O.

Primary couplings

Module Relationship
meta/docs/stack/specs/ipc/protocol.kmd Normative wire protocol this crate implements
engines/sdk/koder_ipc (Dart) Sibling binding — same protocol, different language
engines/sdk/go/ipc Sibling binding — same protocol, different language

Public API

// Client
let mut client = IpcClient::connect("dek").await?;
let result = client.send("play", Some(json!({"uri": "..."}))).await?;

// Server
let mut srv = IpcServer::new("dek");
srv.handle("greet", |req: Request| async move {
    Ok(json!({"hello": req.params.as_ref()
        .and_then(|p| p["name"].as_str())
        .unwrap_or("world")}))
});
srv.listen().await?;

// Discovery
let apps = discover_services().await?;
let alive = is_running("dek").await;

Error types

Variant Trigger
Error::Io Socket connectreadwrite failure
Error::Json Malformed JSON-RPC message
Error::Remote { code, message } Remote handler returned error
Error::Timeout Request exceeded 10s
Error::Closed Connection closed before response
Error::UnsupportedPlatform Non-LinuxmacOSWindows target

Status

v0.1.0 — builds clean on Linux. Windows named pipe (tokio-named-pipes) and macOS XPC pending.

Source: ../home/koder/dev/koder/meta/docs/stack/modules/sdk-rust-koder-ipc.md