Crates.io | ipc-rpc |
lib.rs | ipc-rpc |
version | 1.2.6 |
source | src |
created_at | 2022-09-13 03:35:50.142282 |
updated_at | 2022-10-17 01:54:25.180647 |
description | A wrapper over servo/ipc-channel which provides many high level features |
homepage | |
repository | https://github.com/Xaeroxe/ipc-rpc |
max_upload_size | |
id | 664206 |
size | 107,803 |
Inter-Process Communication Remote Procedure Calls
This Rust library is a wrapper over servo/ipc-channel
that adds many new features.
schemars
.Compatible with anything that can run servo/ipc-channel
, which at time of writing includes
Additionally, servo/ipc-channel
supports the following platforms but only while in inprocess
mode, which is not capable of communication between processes.
This crate uses the tokio
runtime for executing futures, and it is a hard requirement that users of ipc-rpc
must use tokio
. There are no plans to add support for other
executors, but sufficient demand for other executors may change that.
This crate exposes one feature, message-schema-validation
, which is on by default. This enables functionality related to the schemars
crate.
When enabled, the software will attempt to validate the user message schema on initialization of the connection. Failure to validate is not a critical failure, and won't crash the program.
An error will be emitted in the logs, and this status can be retrieved programmatically via many functions, all called schema_validated()
.
If you decide that a failure to validate the schema should be a critical failure you can add the following line of code to your program for execution after a connection is established.
server.schema_validated().await.unwrap().assert_success();
client.schema_validated().await.unwrap().assert_success();
The examples include a client and a server which are meant to be run together. The sequence for using them is
cargo build --examples
cargo run --example server
The server launches the client as part of its operation.
Much like servo/ipc-channel
, servers may only serve one client. Overcoming this limitation would require work within servo/ipc-channel
.