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
//! Supported Ethereum JSON-RPC transports.

pub mod batch;

pub use self::batch::Batch;
pub mod either;
pub use self::either::Either;

#[cfg(any(feature = "http", feature = "http-rustls"))]
pub mod http;
#[cfg(any(feature = "http", feature = "http-rustls"))]
pub use self::http::Http;

#[cfg(any(feature = "ws-tokio", feature = "ws-async-std"))]
pub mod ws;
#[cfg(any(feature = "ws-tokio", feature = "ws-async-std"))]
pub use self::ws::WebSocket;

#[cfg(feature = "ipc-tokio")]
pub mod ipc;
#[cfg(feature = "ipc-tokio")]
pub use self::ipc::Ipc;

#[cfg(any(feature = "test", test))]
pub mod test;

#[cfg(feature = "url")]
impl From<url::ParseError> for crate::Error {
    fn from(err: url::ParseError) -> Self {
        use crate::error::TransportError;
        crate::Error::Transport(TransportError::Message(format!("failed to parse url: {}", err)))
    }
}

#[cfg(feature = "async-native-tls")]
impl From<async_native_tls::Error> for crate::Error {
    fn from(err: async_native_tls::Error) -> Self {
        use crate::error::TransportError;
        crate::Error::Transport(TransportError::Message(format!("{:?}", err)))
    }
}

#[cfg(feature = "eip-1193")]
pub mod eip_1193;