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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
use crate::{encoding::internal::autogen, message as msg};
impl From<msg::DownstreamCall> for autogen::DownstreamCall {
fn from(c: msg::DownstreamCall) -> Self {
Self {
call_id: c.call_id,
source_node_id: c.source_node_id,
name: c.name,
r#type: c.f_type,
request_call_id: c.request_call_id,
payload: c.payload,
..Default::default()
}
}
}
impl From<autogen::DownstreamCall> for msg::DownstreamCall {
fn from(c: autogen::DownstreamCall) -> Self {
Self {
call_id: c.call_id,
source_node_id: c.source_node_id,
name: c.name,
f_type: c.r#type,
request_call_id: c.request_call_id,
payload: c.payload,
}
}
}
impl From<autogen::DownstreamCall> for msg::Message {
fn from(c: autogen::DownstreamCall) -> Self {
Self::DownstreamCall(c.into())
}
}
impl From<msg::UpstreamCall> for autogen::UpstreamCall {
fn from(c: msg::UpstreamCall) -> Self {
Self {
call_id: c.call_id,
name: c.name,
destination_node_id: c.destination_node_id,
r#type: c.f_type,
request_call_id: c.request_call_id,
payload: c.payload,
..Default::default()
}
}
}
impl From<autogen::UpstreamCall> for msg::UpstreamCall {
fn from(c: autogen::UpstreamCall) -> Self {
Self {
call_id: c.call_id,
destination_node_id: c.destination_node_id,
name: c.name,
f_type: c.r#type,
request_call_id: c.request_call_id,
payload: c.payload,
}
}
}
impl From<autogen::UpstreamCall> for msg::Message {
fn from(c: autogen::UpstreamCall) -> Self {
Self::UpstreamCall(c.into())
}
}
impl From<autogen::UpstreamCallAck> for msg::UpstreamCallAck {
fn from(a: autogen::UpstreamCallAck) -> Self {
Self {
call_id: a.call_id,
result_code: a.result_code.into(),
result_string: a.result_string,
}
}
}
impl From<msg::UpstreamCallAck> for autogen::UpstreamCallAck {
fn from(a: msg::UpstreamCallAck) -> Self {
Self {
call_id: a.call_id,
result_code: a.result_code.into(),
result_string: a.result_string,
..Default::default()
}
}
}
impl From<autogen::UpstreamCallAck> for msg::Message {
fn from(c: autogen::UpstreamCallAck) -> Self {
Self::UpstreamCallAck(c.into())
}
}