jsonrpc_tcp_server/lib.rs
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
//! jsonrpc server over tcp/ip
//!
//! ```no_run
//! use jsonrpc_core::*;
//! use jsonrpc_tcp_server::ServerBuilder;
//!
//! fn main() {
//! let mut io = IoHandler::default();
//! io.add_sync_method("say_hello", |_params| {
//! Ok(Value::String("hello".to_string()))
//! });
//! let server = ServerBuilder::new(io)
//! .start(&"0.0.0.0:0".parse().unwrap())
//! .expect("Server must start with no issues.");
//!
//! server.wait();
//! }
//! ```
#![deny(missing_docs)]
use jsonrpc_server_utils as server_utils;
pub use jsonrpc_core;
#[macro_use]
extern crate log;
#[cfg(test)]
#[macro_use]
extern crate lazy_static;
mod dispatch;
mod meta;
mod server;
mod service;
#[cfg(test)]
mod logger;
#[cfg(test)]
mod tests;
use jsonrpc_core as jsonrpc;
pub(crate) use crate::jsonrpc::futures;
pub use self::server_utils::{codecs::Separator, tokio};
pub use crate::dispatch::{Dispatcher, PushMessageError};
pub use crate::meta::{MetaExtractor, RequestContext};
pub use crate::server::{Server, ServerBuilder};