1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Abstractions of a **transport** that carries out an actual communication for `remote-trait-object`.
//!
//! You have to implement these traits in your own requirement, to use `remote-trait-object` over them.
//! It can be ordinary in-process communication, inter-process communication, or even networking over
//! different machines.
pub
/// An error that can be returned in [`send()`] or [`recv()`].
///
/// Note that only `Timeout` and `Termination` will be handled specially by the `remote-trait-object` context.
/// All other errors must be wrapped as `Custom`, and it will be just conveyed to the user.
///
/// [`send()`]: trait.TransportSend.html#tymethod.send
/// [`recv()`]: trait.TransportRecv.html#tymethod.recv
/// An abstraction of a sending half of the transport
///
/// All outgoing packets will be delivered to a single instance of this trait, which has been given
/// when [`Context`] is created.
///
/// [`Context`]: ../struct.Context.html
/// An abstraction of a receiving half of the transport
///
/// All incoming packets will be delivered by a single instance of this trait, which has been given
/// when [`Context`] is created.
///
/// [`Context`]: ../struct.Context.html
/// A switch that can be separately managed by another thread.
///
/// This is the only way to wake up a blocking [`send()`] or [`recv()`] by yourself. (Not by the other end)
/// [`TransportSend`] and [`TransportRecv`] must be able to provide such a switch that triggers [`Termination`] error for its own [`send()`] or [`recv()`].
///
/// [`TransportSend`]: trait.TransportSend.html
/// [`TransportRecv`]: trait.TransportRecv.html
/// [`send()`]: trait.TransportSend.html#tymethod.send
/// [`recv()`]: trait.TransportRecv.html#tymethod.recv
/// [`Termination`]: enum.TransportError.html#variant.Termination