rapace

RPC over SHM / WS / TCP / MEM.

an unpretentious universal system for talking to other stuff.

rapace is a small IPC/RPC library for Rust. It was originally written so dodeca could talk to plugins as separate processes instead of linking everything into one binary.

It provides:

  • A #[rapace::service] proc macro for defining request/response interfaces
  • Integration with facet for serialization, deserialization, and type introspection
  • postcard as the primary binary wire format, with room for others
  • A small set of transports with a common API
  • Basic support for unary and streaming RPCs

Example service (see the crate documentation for more):

use rapace::prelude::*;

#[rapace::service]
pub trait Calculator {
    async fn add(&self, a: i32, b: i32) -> i32;
}

This generates client and server types for Calculator. The same trait can be used over in-memory, shared-memory, WebSocket, or stream-based transports.

Transports

Today rapace ships with:

  • Shared memory transport (used by dodeca for host↔plugin)
  • WebSocket transport (used by browser-based tools)
  • In-memory transport (mainly for tests and experiments)
  • Stream transport (TCP/Unix); present but not currently used here