Expand description
MessagePack-RPC implementation in Rust.
Provides asynchronous RPC servers and clients over TCP and Unix domain sockets. Implements the full MessagePack-RPC specification.
Both servers and clients can handle incoming RPC messages, enabling bidirectional communication.
To implement a server:
- Implement the
Connection
trait - Create a
Server
with the service - Call
server.tcp(addr)
orserver.unix(path)
- Call
server.run()
To implement a client:
- Implement the
Connection
trait - Create a
Client
viaClient::connect_tcp(addr)
orClient::connect_unix(path)
- Use
client.send_request()
orclient.send_notification()
Structs§
- Client
- RPC client for connecting to a server over TCP or Unix domain sockets.
- Connection
Maker Fn - Notification
- An RPC notification message containing a method name and parameters.
- Request
- An RPC request message containing an ID, method name, and parameters.
- Response
- An RPC response message containing an ID and either a result or an error.
- RpcSender
- The interface for sending RPC requests and notifications.
- Server
- RPC server that can listen on TCP or Unix domain sockets. The service type must implement the
RpcService
trait andDefault
. A new service instance is created for each connection. - Service
Error - An error that occurred during the execution of an RPC service method.
Enums§
- Message
- Represents the different types of RPC messages: requests, responses, and notifications.
- RpcError
- Errors that can occur during RPC operations.
- Value
- Represents any valid MessagePack value.
Traits§
- Connection
- A single Connection in an RPC server or client. For server connections, a new instance of the Connection is created for each incoming connection. For clients, a single instance is used for the lifetime of the connection.
- Connection
Maker - A trait for creating connections.