yerpc_handler

Function yerpc_handler 

Source
pub fn yerpc_handler<State, Server, Fun, Fut>(
    handler: Fun,
) -> impl Endpoint<State>
where State: Send + Sync + Clone + 'static, Fun: Fn(Request<State>, RpcClient) -> Fut + Sync + Send + 'static, Fut: Future<Output = Result<Server>> + Send + 'static, Server: RpcServer,
Expand description

A Tide endpoint for a JSON-RPC 2.0 websocket.

The handler closure has to return a type that implements [yerpc::RpcHandler]. Either implement that manually or use yerpc_derive::rpc. See the webserver example for a usage example.