Crate roam_session

Crate roam_session 

Source
Expand description

Session/state machine and RPC-level utilities.

Canonical definitions live in docs/content/spec/_index.md, docs/content/rust-spec/_index.md, and docs/content/shm-spec/_index.md.

Re-exports§

pub use driver::ConnectError;
pub use driver::ConnectionError;
pub use driver::Driver;
pub use driver::FramedClient;
pub use driver::HandshakeConfig;
pub use driver::IncomingConnection;
pub use driver::IncomingConnections;
pub use driver::MessageConnector;
pub use driver::Negotiated;
pub use driver::NoDispatcher;
pub use driver::RetryPolicy;
pub use driver::accept_framed;
pub use driver::connect_framed;
pub use driver::connect_framed_with_policy;
pub use driver::initiate_framed;
pub use transport::MessageTransport;

Modules§

diagnostic
Diagnostic state tracking for SIGUSR1 dumps.
driver
Bidirectional connection driver for message-based transports.
runtime
Runtime abstraction layer for tokio/WASM portability.
transport
Message transport abstraction.

Structs§

CallFuture
A future representing an RPC call that can be configured with metadata.
ChannelIdAllocator
Allocates unique stream IDs with correct parity.
ChannelRegistry
Registry of active streams for a connection.
ConnectionHandle
Handle for making outgoing RPC calls.
Context
Context passed to service method implementations.
DriverTxSlot
A wrapper around Option<Sender<DriverMessage>> that implements Facet.
ForwardingDispatcher
A dispatcher that forwards all requests to an upstream connection.
Frame
Owned frame for sending, receiving, or routing.
InfiniteCredit
No-op flow control for infinite credit mode.
LateBoundForwarder
A dispatcher that forwards all requests to a late-bound upstream connection.
LateBoundHandle
A handle that can be set once after creation.
MsgDesc
Message descriptor (64 bytes) per SHM spec.
Never
OwnedMessage
A deserialized value co-located with its backing frame.
ReceiverSlot
A wrapper around Option<Receiver<Vec<u8>>> that implements Facet.
RequestIdGenerator
Generates unique request IDs for a connection.
ResponseData
Response data returned from a call, including any response stream channels.
RoutedDispatcher
A dispatcher that routes to one of two dispatchers based on method ID.
Rx
Rx stream handle - caller receives data from callee.
SenderSlot
A wrapper around Option<Sender<Vec<u8>>> that implements Facet.
Tunnel
A bidirectional byte tunnel over roam channels.
Tx
Tx stream handle - caller sends data to callee.

Enums§

CallError
Error from making an outgoing call.
ChannelError
Error when routing stream data.
ClientError
DecodeError
Error decoding a response payload.
DispatchError
DriverMessage
All messages to the connection driver go through a single channel.
Payload
Payload storage for a frame.
RoamError
Call error type encoded in RPC responses.
Role
Connection role - determines stream ID parity.
RxError
Error when receiving from a Rx stream.
TransportError
Transport-level call error (no user error type).
TxError
Error when sending on a Tx stream.

Constants§

DEFAULT_TUNNEL_CHUNK_SIZE
Default chunk size for tunnel pumps (32KB).

Traits§

Caller
Trait for making RPC calls.
FlowControl
Abstraction for stream flow control mechanism.
ServiceDispatcher
Trait for dispatching requests to a service.

Functions§

channel
Create an unbound channel pair for streaming RPC.
collect_channel_ids
Collect channel IDs from args by walking with Peek.
decode_response
Decode a response payload into the expected type.
dispatch_call
Helper for dispatching RPC methods with minimal generated code.
dispatch_call_infallible
Dispatch helper for infallible methods (those that return T instead of Result<T, E>).
dispatch_unknown_method
Send an “unknown method” error response.
patch_channel_ids
Patch channel IDs into deserialized args by walking with Poke.
pump_read_to_tx
Pump bytes from an AsyncRead into a Tx<Vec<u8>>.
pump_rx_to_write
Pump bytes from an Rx<Vec<u8>> into an AsyncWrite.
tunnel_pair
Create a pair of connected tunnels.
tunnel_stream
Tunnel a bidirectional stream through a roam Tunnel.

Type Aliases§

BorrowedCallResult
CallResult
ChannelId
Stream ID type.