Expand description
This crate implements a JSON-RPC HTTP server using warp. It accepts POST requests
at /
and requests over websocket at /ws
.
Structs§
- Allow
List Dispatcher - Dispatcher that only allows specified methods.
- Config
- The server configuration
- Cors
- CORS configuration
- Credentials
- Basic auth credentials, containing username and password.
- Credentials
Verification Error - Invalid username or password was passed to
Credentials::verify
. - Modular
Dispatcher - A dispatcher, that can be composed from other dispatchers.
- Notify
- Notifies a single task to wake up.
- Server
- A JSON-RPC server.
Enums§
Traits§
- Dispatcher
- A method dispatcher. These take a request and handle the method execution. Can be generated from an
impl
block usingnimiq_jsonrpc_derive::service
.
Functions§
- connect_
stream - Connects a stream such that its items are sent to the client as notifications.
- dispatch_
method_ with_ args - Read the request and call a handler function if possible. This variant accepts calls with arguments.
- dispatch_
method_ without_ args - Read the request and call a handler function if possible. This variant accepts calls without arguments.
- error_
response - Constructs an error response if necessary (i.e., if the request ID was set).
- method_
not_ found - Returns an error response for a method that was not found. This returns
None
, if the request doesn’t expect a response.
Type Aliases§
- Response
AndSub Scription Notifier - Type defining a response and a possible notify handle used to terminate a subscription stream