mrpc
A MessagePack-RPC implementation in Rust.
Features
- Write asynchronous RPC servers and clients
- Support for TCP and Unix domain sockets
- Full msgpack-rpc implementation (requests, responses, notifications)
- Support for bidirectional communication - both servers and clients can handle incoming RPC messages
- Built on
tokiofor async I/O - Uses
rmpvfor MessagePack serialization - Optional
serdefeature for typed calls and helpers - Managed server and client shutdown with
ServerHandle,Client::shutdown, andClient::close - Custom asynchronous transports, including in-memory duplex streams
- Structured service, protocol, connection, and disconnect errors
- Early request IDs through
RequestHandlefor cancellation and other out-of-band protocols
Quick Start
use ;
use Value;
/// Echo service that returns the method and first parameter.
;
async
Serde Feature
Enable the serde feature to unlock typed call/notify APIs and helpers for converting between
Rust types and MessagePack values/params.
Typed client-side calls (params and responses):
client.notify.await?;
let sum: i64 = client.call.await?;
println!;
Typed server-side helpers (decode params and encode responses):
/// Typed handler for a positional-params method.
/// Typed handler for a single-param notification.