Expand description
jsonrpc http server.
extern crate jsonrpc_core;
extern crate jsonrpc_http_server;
use jsonrpc_core::*;
use 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
- Host type
- Origin
- Request Origin
- Response
- Simple server response structure
- Rpc
- RPC Handler bundled with metadata extractor.
- Server
- jsonrpc http server instance
- Server
Builder - Convenient JSON-RPC HTTP Server builder.
- Server
Handler - jsonrpc http request handler.
Enums§
- Access
Control Allow Origin - Origins allowed to access
- Cors
Header - CORS Header Result.
- Domains
Validation - Specifies if domains should be validated.
- Error
- RPC Server startup error.
- Request
Middleware Action - Action undertaken by a middleware.
Traits§
- Meta
Extractor - Extracts metadata from the HTTP request.
- Request
Middleware - Allows to intercept request and handle it differently.
Functions§
- cors_
header - Returns a CORS header that should be returned with that request.
- is_
host_ allowed - Returns
true
if Host header in request matches a list of allowed hosts.
Type Aliases§
- Server
Result - Result of starting the Server.