Skip to main content

read_request

Function read_request 

Source
pub async fn read_request<R>(
    reader: &mut R,
) -> Result<Option<IpcRequest>, IpcError>
where R: AsyncBufRead + Unpin,
Expand description

Read a single JSON-RPC request from a newline-delimited stream.

Returns Ok(None) on clean EOF (the client closed the connection). Returns Err with an IpcError if the line cannot be parsed.

The reader should be a BufReader wrapping the socket’s read half.