Struct jsonrpsee_http_server::HttpServerBuilder [−][src]
pub struct HttpServerBuilder { /* fields omitted */ }Expand description
Builder to create JSON-RPC HTTP server.
Implementations
Sets the maximum size of a request body in bytes (default is 10 MiB).
Sets access control settings.
Enables or disables HTTP keep-alive.
Default is true.
Register a new resource kind. Errors if label is already registered, or if the number of
registered resources on this server instance would exceed 8.
See the module documentation for resurce_limiting
for details.
Configure a custom tokio::runtime::Handle to run the server on.
Default: tokio::spawn
Finalizes the configuration of the server.
#[tokio::main]
async fn main() {
let listener = std::net::TcpListener::bind("127.0.0.1:0").unwrap();
let occupied_addr = listener.local_addr().unwrap();
let addrs: &[std::net::SocketAddr] = &[
occupied_addr,
"127.0.0.1:0".parse().unwrap(),
];
assert!(jsonrpsee_http_server::HttpServerBuilder::default().build(occupied_addr).is_err());
assert!(jsonrpsee_http_server::HttpServerBuilder::default().build(addrs).is_ok());
}Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Builder
impl !UnwindSafe for Builder
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more