witty_jsonrpc/
lib.rs

1//! # witty-jsonrpc
2//!
3//! An extensible JSON-RPC server that can listen over multiple transports at once.
4//!
5//! ## Supported transports
6//! - HTTP
7//! - TCP sockets
8//! - WebSockets
9//! - Whatever `T` you do `impl<H> Transport<H> for T where H: Handler`
10
11#![deny(rust_2018_idioms)]
12#![deny(non_upper_case_globals)]
13#![deny(non_camel_case_types)]
14#![deny(non_snake_case)]
15#![deny(unused_mut)]
16#![deny(missing_docs)]
17
18/// Traits and implementations enabling compatibility with different IO handlers.
19pub mod handler;
20/// Traits and implementations of mono-transport and multi-transport servers.
21pub mod server;
22/// Traits and implementations of message transports (e.g. HTTP, TCP, WS, etc.)
23pub mod transports;
24
25/// Make it easy for 3rd party projects to import all the right structures and traits to start using
26/// this library immediately.
27pub mod prelude {
28    pub use jsonrpc_core::Value;
29    pub use jsonrpc_pubsub::PubSubHandler;
30
31    #[cfg(feature = "http")]
32    pub use crate::transports::http::{HttpTransport, HttpTransportSettings};
33    #[cfg(feature = "tcp")]
34    pub use crate::transports::tcp::{TcpTransport, TcpTransportSettings};
35    #[cfg(feature = "ws")]
36    pub use crate::transports::ws::{WsTransport, WsTransportSettings};
37    pub use crate::{
38        handler::Session,
39        server::{
40            MultipleTransportsServer, Server, SingleTransportServer, WittyMonoServer,
41            WittyMultiServer,
42        },
43    };
44}