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
use crate::methods::Method;
use serde::*;
use std::collections::BTreeSet;
#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct RequestId(pub u64);
#[derive(Debug, Clone, Serialize)]
pub struct ApiKey(pub String);
#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum ApiKeyStatus {
Stopped,
Paused,
Running,
}
#[derive(Debug, Clone, Serialize)]
pub struct AllowedCharacters(pub BTreeSet<char>);
#[derive(Debug, Clone, Serialize)]
pub struct Request<Params: Serialize> {
#[serde(rename = "jsonrpc")]
pub json_rpc: String,
pub method: Method,
pub params: Params,
pub id: RequestId,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Response<ResponseResult> {
#[serde(rename = "jsonrpc")]
pub json_rpc: String,
pub result: ResponseResult,
pub id: RequestId,
}