Expand description
jsonrpc http server.
extern crate rs_jsonrpc_core;
extern crate rs_jsonrpc_http_server;
use rs_jsonrpc_core::*;
use rs_jsonrpc_http_server::*;
fn main() {
let mut io = IoHandler::new();
io.add_method("say_hello", |_: Params| {
Ok(Value::String("hello".to_string()))
});
let _server = ServerBuilder::new(io).start_http(&"127.0.0.1:3030".parse().unwrap());
}
Re-exports§
pub extern crate hyper;
pub use server_utils::tokio_core;
Structs§
- Host type
- Request Origin
- Simple server response structure
- RPC Handler bundled with metadata extractor.
- jsonrpc http server instance
- Convenient JSON-RPC HTTP Server builder.
- jsonrpc http request handler.
Enums§
- Origins allowed to access
- CORS Header Result.
- Specifies if domains should be validated.
- Action undertaken by a middleware.
- REST -> RPC converter state.
Traits§
- Extracts metadata from the HTTP request.
- Allows to intsrcept request and handle it differently.
Functions§
- Returns a CORS header that should be returned with that request.
- Returns
true
if Host header in request matches a list of allowed hosts.