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
use Result;
/// The [`Backend`] is responsible for sending and receiving RPCs.
/// The [`Backend`] serializes and deserializes the packages and sends and reveices them over a chsen channel.
///
/// # Incomming RPCs
/// The [`Backend`] is acting as server.
///
/// Incomming calls from the client are passed on to the [`Frontend`](crate::interfaces::Frontend) as [`Call`](crate::Call)<[`Intermediate`](Backend::Intermediate)`>`.
/// The [`Reply`](crate::Reply)<[`Intermediate`](Backend::Intermediate)`>`s from the [`Frontend`](crate::interfaces::Frontend) are sent back to the client.
///
/// # Outgoing RPCs
/// The [`Backend`] is acting as client.
///
/// The [`Frontend`](crate::interfaces::Frontend) passes [`Call`](crate::Call)<[`Intermediate`](Backend::Intermediate)`>`s to the [`Backend`] which sends them to the server.
/// The replies are received from the server and passed on to the [`Frontend`](crate::interfaces::Frontend) as [`Reply`](crate::Reply)<[`Intermediate`](Backend::Intermediate)`>`s.
///
/// # Examples
/// For examples look at the provided [`Backend`]s:
/// * [`Http`](/merfolk_backend_http)
/// * [`InProcess`](/merfolk_backend_in_process)
/// * [`SerialPort`](/merfolk_backend_serialport)