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
use crate::v2::params::{Id, JsonRpcNotificationParams, JsonRpcNotificationParamsAlloc, TwoPointZero};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct JsonRpcResponse<'a, T> {
pub jsonrpc: TwoPointZero,
pub result: T,
#[serde(borrow)]
pub id: Id<'a>,
}
#[derive(Serialize)]
pub struct JsonRpcSubscriptionResponse<'a> {
pub jsonrpc: TwoPointZero,
pub method: &'a str,
pub params: JsonRpcNotificationParams<'a>,
}
#[derive(Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct JsonRpcSubscriptionResponseAlloc<'a, T> {
pub jsonrpc: TwoPointZero,
pub method: &'a str,
pub params: JsonRpcNotificationParamsAlloc<T>,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct JsonRpcNotifResponse<'a, T> {
pub jsonrpc: TwoPointZero,
pub method: &'a str,
pub params: T,
}