Docs.rs
  • jsonrpc-http-server-14.2.0
    • jsonrpc-http-server 14.2.0
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • debris
    • github:paritytech:core-devs
    • Dependencies
      • hyper ^0.12 normal
      • jsonrpc-core ^14.2 normal
      • jsonrpc-server-utils ^14.2 normal
      • log ^0.4 normal
      • net2 ^0.2 normal
      • parking_lot ^0.10.0 normal
      • unicase ^2.0 normal
      • env_logger ^0.7 dev
    • Versions
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
☰
logo

Crate jsonrpc_http_server

See all jsonrpc_http_server's items

  • Re-exports
  • Modules
  • Structs
  • Enums
  • Traits
  • Functions

Crates

  • jsonrpc_http_server
Change settings

[−][src]Crate jsonrpc_http_server

[−] Expand description

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())
	.expect("Unable to start RPC server");

_server.wait();
}

Re-exports

pub use hyper;
pub use jsonrpc_core;
pub use crate::server_utils::tokio;

Modules

cors

CORS handling utility functions

Structs

CloseHandle

Handle used to close the server. Can be cloned and passed around to different threads and be used to close a server that is wait()ing.

Host

Host type

Origin

Request Origin

Response

Simple server response structure

Rpc

RPC Handler bundled with metadata extractor.

Server

jsonrpc http server instance

ServerBuilder

Convenient JSON-RPC HTTP Server builder.

ServerHandler

jsonrpc http request handler.

SuspendableStream

Incoming is a stream of incoming sockets Polling the stream may return a temporary io::Error (for instance if we can't open the connection because of "too many open files" limit) we use for_each combinator which:

WeakRpc

A weak handle to the RPC server.

Enums

AccessControlAllowOrigin

Origins allowed to access

AllowCors

CORS response headers

DomainsValidation

Specifies if domains should be validated.

RequestMiddlewareAction

Action undertaken by a middleware.

RestApi

REST -> RPC converter state.

Traits

MetaExtractor

Extracts metadata from the HTTP request.

RequestMiddleware

Allows to intercept request and handle it differently.

Functions

cors_allow_headers

Returns the CORS AllowHeaders header that should be returned with that request.

cors_allow_origin

Returns a CORS AllowOrigin header that should be returned with that request.

is_host_allowed

Returns true if Host header in request matches a list of allowed hosts.

Results for DoubleEndedIterator

In Names
(0)
In Parameters
(0)
In Return Types
(0)
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.

Keyboard Shortcuts

?
Show this help dialog
S
Focus the search field
↑
Move up in search results
↓
Move down in search results
↹
Switch tab
⏎
Go to active search result
+
Expand all sections
-
Collapse all sections

Search Tricks

Prefix searches with a type followed by a colon (e.g., fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g., vec -> usize or * -> vec)

Search multiple things at once by splitting your query with comma (e.g., str,u8 or String,struct:Vec,test)

You can look for items with an exact name by putting double quotes around your request: "string"

Look for items inside another one by searching for a path: vec::Vec