A high-performance RPC framework for Rust with support for shared memory, TCP, WebSocket, and in-process transports.
-
Multiple transports: Choose the right transport for your use case
- Shared memory (SHM): Ultra-low latency for local processes
- TCP/Unix sockets: Network communication
- WebSocket: Browser and web clients
- In-memory: Testing and single-process RPC
-
Streaming: Full support for server and client streaming
-
Code generation: Write your service interface once with
#[rapace::service] -
Type-safe: Compile-time verification of RPC calls
-
Cross-platform: Linux, macOS, Windows, and WebAssembly
use rapace::service;
use rapace::RpcSession;
use rapace_transport_mem::MemTransport;
#[rapace::service]
pub trait Calculator {
async fn add(&self, a: i32, b: i32) -> i32;
}
// Implement your service...
struct MyCalculator;
impl Calculator for MyCalculator {
async fn add(&self, a: i32, b: i32) -> i32 {
a + b
}
}
// Use it with any transport
let (client_transport, server_transport) = MemTransport::pair();
let session = RpcSession::new(client_transport);
let client = CalculatorClient::new(session);See the crate documentation and examples.
- rapace: Main framework (re-exports transports)
- rapace-core: Core types and protocols
- rapace-macros: Service macro
- rapace-registry: Service metadata
- Transports:
- rapace-transport-mem
- rapace-transport-stream (TCP/Unix)
- rapace-transport-websocket
- rapace-transport-shm
- rapace-explorer: Dynamic service discovery
- rapace-testkit: Transport conformance tests
Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.
The facet logo was drawn by Misiasart.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.