Skip to main content

Crate roam

Crate roam 

Source
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§

session

Structs§

AcceptedConnection
Result of accepting a virtual connection.
Attachment
One transport attachment consumed by LinkSource::next_link.
BareConduit
Wraps a Link with postcard serialization. No reconnect, no reliability.
BareConduitPermit
BareConduitRx
BareConduitTx
ChannelId
ID of a channel between two peers.
ConnectionHandle
ConnectionId
Connection ID identifying a virtual connection on a link.
ConnectionSettings
Per-connection limits advertised by a peer.
ConnectionState
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.
DriverCaller
Implements Caller: allocates a request ID, registers a response slot, sends the call through the connection, and awaits the response.
DriverChannelSink
Concrete ChannelSink backed by a ConnectionSender.
DriverReplySink
Concrete ReplySink implementation for the driver.
ErasedCaller
Type-erased Caller wrapper used by generated clients.
MemoryLink
In-process Link backed by tokio mpsc channels.
MemoryLinkRx
Receiving half of a MemoryLink.
MemoryLinkRxError
MemoryLink never fails on recv — the only “error” is channel closed (returns None).
MemoryLinkTx
Sending half of a MemoryLink.
MemoryLinkTxPermit
MemoryWriteSlot
Write slot for MemoryLinkTx.
MessageFamily
Type-level tag for Message as a MsgFamily.
MetadataEntry
A single metadata entry with a key, value, and flags.
MetadataFlags
Metadata entry flags.
MethodDescriptor
Static descriptor for a single RPC method.
MethodId
A unique method identifier — hash of service name, method name, arg shapes, return shape
NoopCaller
Liveness-only handle for a connection root.
RequestCall
RequestResponse
ResponseParts
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 type T.
SelfRef
A decoded value T that may borrow from its own backing storage.
ServiceDescriptor
Static descriptor for a roam RPC service.
Session
Session state machine.
SessionAcceptorBuilder
SessionHandle
Cloneable handle for opening and closing virtual connections.
SessionInitiatorBuilder
SessionKeepaliveConfig
Session-level protocol keepalive configuration.
SinkCall
Concrete Call implementation backed by a ReplySink.
SplitLink
Link wrapper that re-combines pre-split Tx/Rx halves into a Link.
StableConduit
StableConduitPermit
StableConduitRx
StableConduitTx
Tx
Sender handle: “I send”. The holder of a Tx<T> sends items of type T.

Enums§

Backing
BareConduitError
MetadataValue
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.
RoamError
Protocol-level error wrapper distinguishing application errors from roam infrastructure errors.
RxError
Error when receiving from an Rx.
SessionError
Errors that can occur during session establishment or operation.
StableConduitError
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 Link and owns serialization.
ConduitAcceptor
Yields new conduits from inbound connections.
ConduitRx
Receiving half of a Conduit.
ConduitTx
Sending half of a Conduit.
ConduitTxPermit
Permit for sending exactly one message through a ConduitTx.
ConnectionAcceptor
Callback for accepting or rejecting inbound virtual connections.
DynConduitTx
Handler
IntoConduit
Converts a value into a roam_types::Conduit.
Link
Bidirectional raw-bytes transport.
LinkRx
Receiving half of a Link.
LinkSource
LinkTx
Sending half of a Link.
LinkTxPermit
A permit for allocating exactly one outbound payload.
MsgFamily
Maps a lifetime to a concrete message type.
ReplySink
Sink for sending a reply back to the caller.
WriteSlot
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 RpcPlan for type T. FIXME: requiring ’static here is wrong FIXME: this function is now useless since we have RpcPlan::for_type

Type Aliases§

BoxSessionFuture
A pinned, boxed session future. On non-WASM this is Send + 'static; on WASM it’s 'static only (no Send requirement).
Metadata
A list of metadata entries.

Attribute Macros§

service
Marks a trait as a roam RPC service and generates all service code.