Expand description
Roam — Rust-native RPC where traits are the schema.
This is the facade crate. It re-exports everything needed by both
hand-written code and #[roam::service] macro-generated code.
Re-exports§
pub use facet;pub use facet_postcard;pub use roam_hash as hash;
Modules§
Structs§
- Accepted
Connection - Result of accepting a virtual connection.
- Attachment
- One transport attachment consumed by
LinkSource::next_link. - Bare
Conduit - Wraps a
Linkwith postcard serialization. No reconnect, no reliability. - Bare
Conduit Permit - Bare
Conduit Rx - Bare
Conduit Tx - Channel
Id - ID of a channel between two peers.
- Connection
Handle - Connection
Id - Connection ID identifying a virtual connection on a link.
- Connection
Settings - Per-connection limits advertised by a peer.
- Connection
State - Static data for one active connection.
- Driver
- Per-connection driver. Handles in-flight request tracking, dispatches incoming calls to a Handler, and manages channel state/flow control.
- Driver
Caller - Implements
Caller: allocates a request ID, registers a response slot, sends the call through the connection, and awaits the response. - Driver
Channel Sink - Concrete
ChannelSinkbacked by aConnectionSender. - Driver
Reply Sink - Concrete
ReplySinkimplementation for the driver. - Erased
Caller - Type-erased
Callerwrapper used by generated clients. - Memory
Link - In-process
Linkbacked by tokio mpsc channels. - Memory
Link Rx - Receiving half of a
MemoryLink. - Memory
Link RxError - MemoryLink never fails on recv — the only “error” is channel closed (returns None).
- Memory
Link Tx - Sending half of a
MemoryLink. - Memory
Link TxPermit - Memory
Write Slot - Write slot for
MemoryLinkTx. - Message
Family - Type-level tag for
Messageas aMsgFamily. - Metadata
Entry - A single metadata entry with a key, value, and flags.
- Metadata
Flags - Metadata entry flags.
- Method
Descriptor - Static descriptor for a single RPC method.
- Method
Id - A unique method identifier — hash of service name, method name, arg shapes, return shape
- Noop
Caller - Liveness-only handle for a connection root.
- Request
Call - Request
Response - Response
Parts - A decoded response value paired with response metadata.
- RpcPlan
- Precomputed plan for an RPC type (args, response, or error).
- Rx
- Receiver handle: “I receive”. The holder of an
Rx<T>receives items of typeT. - SelfRef
- A decoded value
Tthat may borrow from its own backing storage. - Service
Descriptor - Static descriptor for a roam RPC service.
- Session
- Session state machine.
- Session
Acceptor Builder - Session
Handle - Cloneable handle for opening and closing virtual connections.
- Session
Initiator Builder - Session
Keepalive Config - Session-level protocol keepalive configuration.
- Sink
Call - Concrete
Callimplementation backed by aReplySink. - Split
Link - Link wrapper that re-combines pre-split Tx/Rx halves into a
Link. - Stable
Conduit - Stable
Conduit Permit - Stable
Conduit Rx - Stable
Conduit Tx - Tx
- Sender handle: “I send”. The holder of a
Tx<T>sends items of typeT.
Enums§
- Backing
- Bare
Conduit Error - Metadata
Value - Metadata value.
- Parity
- Whether a peer will use odd or even IDs for requests and channels on a given connection.
- Payload
- A payload — arguments for a request, or return type for a response.
- Roam
Error - Protocol-level error wrapper distinguishing application errors from roam infrastructure errors.
- RxError
- Error when receiving from an
Rx. - Session
Error - Errors that can occur during session establishment or operation.
- Stable
Conduit Error - TxError
- Error when sending on a
Tx.
Constants§
- PROTOCOL_
VERSION - Current roam session protocol version.
Traits§
- Call
- Represents an in-progress call from a client that must be replied to.
- Caller
- Type-erased handler for incoming service calls.
- Conduit
- Bidirectional typed transport. Wraps a
Linkand owns serialization. - Conduit
Acceptor - Yields new conduits from inbound connections.
- Conduit
Rx - Receiving half of a
Conduit. - Conduit
Tx - Sending half of a
Conduit. - Conduit
TxPermit - Permit for sending exactly one message through a
ConduitTx. - Connection
Acceptor - Callback for accepting or rejecting inbound virtual connections.
- DynConduit
Tx - Handler
- Into
Conduit - Converts a value into a
roam_types::Conduit. - Link
- Bidirectional raw-bytes transport.
- LinkRx
- Receiving half of a
Link. - Link
Source - LinkTx
- Sending half of a
Link. - Link
TxPermit - A permit for allocating exactly one outbound payload.
- MsgFamily
- Maps a lifetime to a concrete message type.
- Reply
Sink - Sink for sending a reply back to the caller.
- Write
Slot - A writable slot in the transport’s output buffer.
Functions§
- acceptor
- bind_
channels_ ⚠callee_ args - Bind channels in deserialized args on the callee side.
- bind_
channels_ ⚠caller_ args - Bind channels in args on the caller side, returning channel IDs.
- channel
- Create a channel pair with shared state.
- initiator
- memory_
link_ pair - Create a pair of connected
MemoryLinks. - prepare_
acceptor_ attachment - Prepare an acceptor-side attachment from an inbound link.
- proxy_
connections - Forward all request/channel traffic between two connections.
- rpc_
plan - Return a process-global cached
&'static RpcPlanfor typeT. FIXME: requiring ’static here is wrong FIXME: this function is now useless since we have RpcPlan::for_type
Type Aliases§
- BoxSession
Future - A pinned, boxed session future. On non-WASM this is
Send + 'static; on WASM it’s'staticonly (noSendrequirement). - Metadata
- A list of metadata entries.
Attribute Macros§
- service
- Marks a trait as a roam RPC service and generates all service code.