1pub mod call;
2mod error;
3pub mod options;
4mod ws;
5
6mod jsonrpc {
8 #[derive(serde::Serialize)]
9 pub struct Request<'a, I, S> {
10 pub jsonrpc: &'a str, pub method: &'a str, #[serde(skip_serializing_if = "Option::is_none")]
13 pub id: Option<I>, #[serde(skip_serializing_if = "Option::is_none")]
15 pub params: Option<S>, }
17
18 #[derive(serde::Deserialize, Debug, Clone)]
19 pub struct Error {
20 pub code: i64,
21 pub message: String,
22 }
23
24 #[derive(serde::Deserialize)]
25 #[serde(untagged)]
26 pub enum Response<I, R, N> {
27 Resp { id: I, result: R },
28 Notification { method: String, params: N },
29 Err { id: I, error: Error },
30 }
31}
32
33
34pub use error::Error;
35pub use ws::{Client, ConnectionMeta, Notification};
36
37pub type Result<T> = std::result::Result<T, Error>;
38