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
pub mod ack;
pub mod fill;
pub mod full;
pub mod result;
pub mod r#type;
use self::ack::Ack;
use self::full::Full;
use self::result::Result;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[serde(untagged)]
pub enum Response {
Full(Full),
Result(Result),
Ack(Ack),
}
impl Response {
pub fn client_order_id(&self) -> String {
match self {
Response::Full(inner) => inner.client_order_id.to_owned(),
Response::Result(inner) => inner.client_order_id.to_owned(),
Response::Ack(inner) => inner.client_order_id.to_owned(),
}
}
}