Struct nanorpc_http::server::HttpRpcServer
source · pub struct HttpRpcServer { /* private fields */ }Expand description
An HTTP-based nanorpc server.
Implementations§
source§impl HttpRpcServer
impl HttpRpcServer
sourcepub async fn bind(addr: SocketAddr) -> Result<Self>
pub async fn bind(addr: SocketAddr) -> Result<Self>
Creates a new HTTP server listening at the given address. Routing is currently not supported.
sourcepub async fn run(&self, service: impl RpcService) -> Result<()>
pub async fn run(&self, service: impl RpcService) -> Result<()>
Runs the server, processing requests with the given RpcService, blocking indefinitely until a fatal failure happens. This must be run for the server to make any progress!