pub async fn serve<S, R, W, I, O, A>(
server: Server<'_, S>,
state: &S,
reader: ReadHalf<R>,
writer: WriteHalf<W>,
request: I,
response: O,
answer: A,
) -> Result<(), Box<dyn Error + Send + Sync>>
Expand description
Read and write line-delimited JSON from a stream executing via a JSON RPC server.
Request and response functions are useful for logging service calls; the answer function can be used to handle replies from a remote method call.