You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides a simple and powerful remote method invocation support based on Rust's trait objects.
13
-
It sets up an connection between two contexts of `remote-trait-object` that may exist over different thread, different processes, or even different machines.
14
-
User can freely export a _service object_, and the user of the other side will import such service as a _proxy object_.
15
-
Both service object and proxy object are expressed in Rust trait objects, which exposes only **methods** that can be remotely served and called.
12
+
`remote-trait-object` is a general, powerful, and simple [remote method invocation](https://en.wikipedia.org/wiki/Distributed_object_communication) library
13
+
based on trait objects.
16
14
17
-
The actual communciation upon which such connection is constructed, is abstracted with `TransportRecv` and `TransportSend`.
18
-
The implementation of the transport must be supplied by the user, and this library itself provides nothing about the communication.
19
-
It can be a plain in-process communication, an Ipc, or even a networking, as you implement.
15
+
It is...
20
16
21
-
## Flow
17
+
1. Based on _services_ that can be exported and imported **as trait objects** -
18
+
You register a service object, which is a trait object, and export it. On the other side, you import it into a proxy object, which is also a trait object.
19
+
1. Based on a point-to-point connection - All operations are conducted upon a single connection, which has **two ends**.
20
+
1. Easy to export and import services - During a remote method call in some service, you **can export and import another service as an argument or a return value** of the method.
21
+
1. Independent from the transport model - The transport model is abstracted and **users must provide a concrete implementation of it**.
22
+
1. Concurrent - you can both **call and handle remote calls concurrently**.
22
23
23
-

24
+
See the [documentation](https://docs.rs/remote-trait-object).
25
+
26
+
## Example
27
+
28
+
[This example code](https://github.com/CodeChain-io/remote-trait-object/blob/master/remote-trait-object-tests/src/simple.rs)
29
+
briefly shows how you can use `remote-trait-object`.
30
+
31
+
Note that `crate::transport::create()` is for creating the transport ends that are provided to `remote-trait-object ` contexts, which is just in-process communication for the test.
32
+
You have to implement your own transport implementation if you're going to actually use this crate./
0 commit comments