Trait RpcHandler

Source
pub trait RpcHandler<const STACK_SIZE: usize = DEFAULT_HANDLER_STACK_SIZE>: Sync {
    // Required method
    fn handle<'a>(
        &'a self,
        id: Option<u64>,
        method: &'a str,
        request_json: &'a [u8],
        response_json: &'a mut [u8],
    ) -> StackFuture<'a, Result<usize, RpcError>, STACK_SIZE> ;
}
Expand description

Trait for RPC handlers TODO: when async closures are stabilized, we should offer a way to register closures directly.

Required Methods§

Source

fn handle<'a>( &'a self, id: Option<u64>, method: &'a str, request_json: &'a [u8], response_json: &'a mut [u8], ) -> StackFuture<'a, Result<usize, RpcError>, STACK_SIZE>

Implementors§