simplejrpc
Unix-domain-socket JSON-RPC 2.0 SDK for Rust · Apache-2.0
Compatible in framing and app envelope with the Go simplejrpc-go library:
- Transport: Unix socket +
Content-Lengthframes (LSP / VS Code style) - App result envelope:
{ code, msg, data, meta }(business errors insideresult, not JSON-RPCerror) - Middleware (onion), JSON config, field validation, registration macros
Repo: DemonZack/simplejrpc-rust
Features
| Area | Details |
|---|---|
| Server / Client | tokio async builders |
| Middleware | request forward, response reverse |
| Errors | typed Error, client-safe messages |
| Config | JSON + test/dev/prod + dotted paths |
| Validation | built-ins + custom Rule / rule_fn |
| Macros | register_methods! / define_rpc_codes*! / validate_object! |
| Safety | max frame body 16 MiB |
Install
[]
= "0.1"
Or from Git:
[]
= { = "https://github.com/DemonZack/simplejrpc-rust" }
Quick start
# another terminal
Server
use ;
use json;
let server = register_methods!.build;
server.serve.await?;
Client
use Client;
use json;
let c = connect.await?;
let v = c.call.await?;
Layout
simplejrpc/
├── src/ # library
├── examples/ # echo server/client
├── tests/ # integration + optional Go interop
├── LICENSE # Apache-2.0
├── CHANGELOG.md
└── CONTRIBUTING.md
Go interop (optional)
tests/cross_lang.rs builds a small Go bridge under tests/interop/go_bridge.
Point replace in that go.mod at a local simplejrpc-go checkout. If Go or the
replace path is missing, the test skips (does not fail CI).
MSRV
Rust 1.75+ (see rust-version in Cargo.toml).
License
Apache-2.0 — see LICENSE.