What is different

Most RPC libraries model a call as arguments followed by one result or a stream attached to that method. Remoc also lets arguments and results contain communication endpoints. A call can return a channel receiver, accept a channel sender or hand out a client for another remote trait.

Rust types are the contract

Traits become remotely callable with #[rtc::remote]. Arguments and results are Serde types, so there is no separate interface language or generated source to keep alongside them.

Either end can serve

The peer that opens a connection can also send back a channel or remote trait client. A device that connects through NAT can therefore expose an interface over the same connection.

One multiplexed connection

Channels, calls and objects share one byte or packet stream. Each has independent flow control, so a receiver that stops reading stalls its own sender rather than unrelated traffic.

See the remote channels and remote trait calls examples.

At a glance

Library Contract Peers Interaction model Useful when
Remoc Rust traits and types via Serde Rust calls, transferable channels (streams) and remote objects Rust programs want stateful communication over one connection
tarpc Rust traits Rust request/response with request context conventional RPC needs propagated trace context
gRPC (tonic) .proto schema many languages request/response and schema-defined streams services cross language boundaries or use HTTP infrastructure
Cap'n Proto .capnp schema many languages calls and transferable capabilities capability-based RPC must work across languages

How the alternatives differ

tarpc

tarpc is the closest alternative: it also defines services as Rust traits without a separate schema. It focuses on request/response RPC; a server may keep application state, but calls do not pass remote channels or object handles. Tarpc provides request contexts with propagated deadlines and tracing metadata. Remoc propagates cancellation when call futures are dropped, but does not automatically propagate tracing context.

gRPC, through tonic

tonic implements gRPC for Rust. A .proto schema defines the service and generates code for each language. Calls run over HTTP/2, which makes gRPC a good match for cross-language APIs and infrastructure that routes, measures or limits individual calls. Remoc instead keeps Rust types as the contract and multiplexes its own channels over the supplied transport.

Cap'n Proto

Cap'n Proto RPC also lets references to callable objects travel in messages and supports pipelining dependent calls. Its schema and capability model work across supported languages. Remoc offers related patterns using Rust traits and channel endpoints, including pipelined trait calls, but is limited to Rust peers.

Limitations

Rust peers only

Remoc's protocol is defined by Rust types and has no implementations for other languages. A language-neutral schema such as Protocol Buffers or Cap'n Proto is needed when a peer is not written in Rust.

Calls are opaque to intermediaries

A proxy sees a Remoc connection as one byte or packet stream. Per-method routing, rate limiting and metrics therefore require application support rather than configuration in an HTTP proxy or service mesh.

Remote values belong to a connection

Channels and remote objects remain attached to the connection and endpoint serving them. They do not move transparently between interchangeable replicas as independent requests can.