Struct solana_jsonrpc_http_server::ServerBuilder[][src]

pub struct ServerBuilder<M: Metadata = (), S: Middleware<M> = NoopMiddleware> { /* fields omitted */ }

Convenient JSON-RPC HTTP Server builder.

Methods

impl<M: Metadata + Default, S: Middleware<M>> ServerBuilder<M, S>
[src]

Creates new ServerBuilder for given IoHandler.

By default:

  1. Server is not sending any CORS headers.
  2. Server is validating Host header.

impl<M: Metadata, S: Middleware<M>> ServerBuilder<M, S>
[src]

Creates new ServerBuilder for given IoHandler.

By default:

  1. Server is not sending any CORS headers.
  2. Server is validating Host header.

Utilize existing event loop executor to poll RPC results.

Applies only to 1 of the threads. Other threads will spawn their own Event Loops.

Enable the REST -> RPC converter.

Allows you to invoke RPCs by sending POST /<method>/<param1>/<param2> requests (with no body). Disabled by default.

Enable health endpoint.

Allows you to expose one of the methods under GET /<path> The method will be invoked with no parameters. Error returned from the method will be converted to status 500 response.

Expects a tuple with (<path>, <rpc-method-name>).

Enables or disables HTTP keep-alive.

Default is true.

Sets number of threads of the server to run.

Panics when set to 0.

Configures a list of allowed CORS origins.

Configure CORS AccessControlMaxAge header returned.

Passing Some(millis) informs the client that the CORS preflight request is not necessary for at least millis ms. Disabled by default.

Configure the CORS AccessControlAllowHeaders header which are allowed.

Configures request middleware

Configures metadata extractor

Allow connections only with Host header set to binding address.

Specify a list of valid Host headers. Binding address is allowed automatically.

Sets the maximum size of a request body in bytes (default is 5 MiB).

Start this JSON-RPC HTTP server trying to bind to specified SocketAddr.

Auto Trait Implementations

impl<M, S> Send for ServerBuilder<M, S>

impl<M, S> Sync for ServerBuilder<M, S>