Skip to main content

Crate vox

Crate vox 

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

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.
ClientContext
Borrowed per-call context exposed to client middleware.
ClientHello
Client’s opening handshake — fixed-size, cast directly from wire bytes.
ClientLogging
ClientLoggingOptions
ClientRequest
Borrowed request wrapper exposed to client middleware.
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. Tracks in-flight request attempts, dispatches incoming requests to a Handler, and manages channel state / flow control.
DriverCaller
Implements Caller: allocates a request ID, registers a response slot, sends one request attempt through the connection, and awaits the corresponding response.
DriverChannelSink
Concrete ChannelSink backed by a ConnectionSender.
DriverReplySink
Concrete ReplySink implementation for the driver.
ErasedCaller
Type-erased Caller wrapper used by generated clients.
Extensions
Per-request type-indexed storage shared across middleware hooks and handlers.
HandshakeResult
Result of a completed CBOR handshake.
InMemoryOperationStore
Default in-memory operation store.
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.
MessagePlan
Pre-built translation plan for deserializing the Message wire type.
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
MiddlewareCaller
NoopCaller
Liveness-only handle for a connection root.
RequestCall
RequestContext
Borrowed per-request context exposed to opted-in Rust service handlers.
RequestResponse
ResponseParts
A decoded response value paired with response metadata.
RetryPolicy
Static retry policy for a method.
Rx
Receiver handle: “I receive”. The holder of an Rx<T> receives items of type T.
SchemaRecvTracker
Tracks schemas received from the remote peer on the current connection.
SealedResponse
A sealed response stored in the operation store.
SelfRef
A decoded value T that may borrow from its own backing storage.
ServerLogging
ServerLoggingOptions
ServiceDescriptor
Static descriptor for a vox RPC service.
Session
Session state machine.
SessionAcceptorBuilder
SessionHandle
Cloneable handle for opening and closing virtual connections.
SessionInitiatorBuilder
SessionKeepaliveConfig
Session-level protocol keepalive configuration.
SessionRegistry
SessionSourceInitiatorBuilder
SessionTransportAcceptorBuilder
SessionTransportInitiatorBuilder
SingleAttachmentSource
A one-shot LinkSource backed by a single attachment.
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.
WithTracker
Pairs a value with the SchemaRecvTracker that 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
BareConduitError
ChannelRetryMode
ClientCallOutcome
HandshakeError
MetadataValue
Metadata value.
OperationState
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.
ServerCallOutcome
Outcome observed by server middleware after handler dispatch.
SessionAcceptOutcome
SessionError
Errors that can occur during session establishment or operation.
SessionRole
Whether the session is acting as initiator or acceptor.
StableConduitError
TransportMode
Requested conduit mode for the transport prologue.
TransportPrologueError
TransportRejectReason
TxError
Error when sending on a Tx.
VoxError
Protocol-level error wrapper distinguishing application errors from vox infrastructure errors.

Constants§

OPERATION_ID_METADATA_KEY
RETRY_SUPPORT_METADATA_KEY
RETRY_SUPPORT_VERSION

Traits§

Call
Represents an in-progress API-level call as seen by a server handler.
Caller
Type-erased handler for incoming service calls.
ClientMiddleware
Conduit
Bidirectional typed transport. Wraps a Link and owns serialization.
ConduitAcceptor
Yields new conduits from inbound connections.
ConduitRx
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.
DynConduitRx
DynConduitTx
Handler
IntoConduit
Converts a value into a vox_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.
MaybeSend
Marker trait that requires Send on native targets, nothing on wasm32.
MaybeSync
Marker trait that requires Sync on native targets, nothing on wasm32.
MsgFamily
Maps a lifetime to a concrete message type.
OperationStore
Operation state backing for exactly-once delivery across session resumption.
ReplySink
Sink for sending the terminal response for one request attempt.
ServerMiddleware
Observe inbound server requests before and after dispatch.
WriteSlot
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 to next_link will fail immediately. Used when the first link is passed directly to StableConduit::with_first_link and 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 ClientHello from a link.
reject_transport
single_attachment_source
Build a one-shot LinkSource from a prepared attachment.
single_link_source
Build a one-shot initiator-side LinkSource from a raw link.
with_channel_binder
Set the thread-local channel binder for the duration of f.

Type Aliases§

BoxMiddlewareFuture
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 vox RPC service and generates all service code.