Expand description
Vox — Rust-native RPC where traits are the schema.
This is the facade crate. It re-exports everything needed by both
hand-written code and #[vox::service] macro-generated code.
Re-exports§
pub use facet;pub use vox_postcard;
Modules§
- channel
- hash
- schema_
deser - session
- testing
- Test utilities for vox-core. Publicly exported for use by integration tests in downstream crates.
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.
- Client
Context - Borrowed per-call context exposed to client middleware.
- Client
Hello - Client’s opening handshake — fixed-size, cast directly from wire bytes.
- Client
Logging - Client
Logging Options - Client
Request - Borrowed request wrapper exposed to client middleware.
- 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. Tracks in-flight request attempts, dispatches
incoming requests to a
Handler, and manages channel state / flow control. - Driver
Caller - Implements
Caller: allocates a request ID, registers a response slot, sends one request attempt through the connection, and awaits the corresponding 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. - Extensions
- Per-request type-indexed storage shared across middleware hooks and handlers.
- Handshake
Result - Result of a completed CBOR handshake.
- InMemory
Operation Store - Default in-memory operation store.
- 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. - Message
Plan - Pre-built translation plan for deserializing the
Messagewire type. - 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
- Middleware
Caller - Noop
Caller - Liveness-only handle for a connection root.
- Request
Call - Request
Context - Borrowed per-request context exposed to opted-in Rust service handlers.
- Request
Response - Response
Parts - A decoded response value paired with response metadata.
- Retry
Policy - Static retry policy for a method.
- Rx
- Receiver handle: “I receive”. The holder of an
Rx<T>receives items of typeT. - Schema
Recv Tracker - Tracks schemas received from the remote peer on the current connection.
- Sealed
Response - A sealed response stored in the operation store.
- SelfRef
- A decoded value
Tthat may borrow from its own backing storage. - Server
Logging - Server
Logging Options - Service
Descriptor - Static descriptor for a vox 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.
- Session
Registry - Session
Source Initiator Builder - Session
Transport Acceptor Builder - Session
Transport Initiator Builder - Single
Attachment Source - A one-shot
LinkSourcebacked by a single attachment. - 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. - With
Tracker - Pairs a value with the
SchemaRecvTrackerthat was active when the value was received. Used to thread per-message schema context through the caller API without storing trackers on long-lived structs.
Enums§
- Backing
- Bare
Conduit Error - Channel
Retry Mode - Client
Call Outcome - Handshake
Error - Metadata
Value - Metadata value.
- Operation
State - State of an operation in the store.
- 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.
- RxError
- Error when receiving from an
Rx. - Server
Call Outcome - Outcome observed by server middleware after handler dispatch.
- Session
Accept Outcome - Session
Error - Errors that can occur during session establishment or operation.
- Session
Role - Whether the session is acting as initiator or acceptor.
- Stable
Conduit Error - Transport
Mode - Requested conduit mode for the transport prologue.
- Transport
Prologue Error - Transport
Reject Reason - TxError
- Error when sending on a
Tx. - VoxError
- Protocol-level error wrapper distinguishing application errors from vox infrastructure errors.
Constants§
Traits§
- Call
- Represents an in-progress API-level call as seen by a server handler.
- Caller
- Type-erased handler for incoming service calls.
- Client
Middleware - Conduit
- Bidirectional typed transport. Wraps a
Linkand owns serialization. - Conduit
Acceptor - Yields new conduits from inbound connections.
- Conduit
Rx - 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
Rx - DynConduit
Tx - Handler
- Into
Conduit - Converts a value into a
vox_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.
- Maybe
Send - Marker trait that requires
Sendon native targets, nothing on wasm32. - Maybe
Sync - Marker trait that requires
Syncon native targets, nothing on wasm32. - MsgFamily
- Maps a lifetime to a concrete message type.
- Operation
Store - Operation state backing for exactly-once delivery across session resumption.
- Reply
Sink - Sink for sending the terminal response for one request attempt.
- Server
Middleware - Observe inbound server requests before and after dispatch.
- Write
Slot - A writable slot in the transport’s output buffer.
Functions§
- accept_
transport - acceptor_
conduit - acceptor_
on - acceptor_
on_ link - Convenience: perform CBOR handshake as acceptor on a raw link, then return a builder with the conduit ready to go.
- acceptor_
transport - channel
- Create a channel pair with shared state.
- ensure_
channel_ retry_ mode - exhausted_
source - Build an already-exhausted
LinkSource. Any call tonext_linkwill fail immediately. Used when the first link is passed directly toStableConduit::with_first_linkand no reconnection source is available. - handshake_
as_ acceptor - Perform the CBOR handshake as the acceptor.
- handshake_
as_ initiator - Perform the CBOR handshake as the initiator.
- initiate_
transport - initiator
- initiator_
conduit - initiator_
on - initiator_
on_ link - Convenience: perform CBOR handshake as initiator on a raw link, then return a builder with the conduit ready to go.
- initiator_
transport - 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.
- recv_
client_ hello - Receive a stable conduit
ClientHellofrom a link. - reject_
transport - single_
attachment_ source - Build a one-shot
LinkSourcefrom a prepared attachment. - single_
link_ source - Build a one-shot initiator-side
LinkSourcefrom a raw link. - with_
channel_ binder - Set the thread-local channel binder for the duration of
f.
Type Aliases§
- BoxMiddleware
Future - 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 vox RPC service and generates all service code.