After read_line returns LineError::TooLong, skip_line discards the rest
of that line without buffering it and leaves the reader at the next
message, so a server can answer the oversized message and keep the
session open. It returns false at EOF and retries interrupted reads.
read_line returned LineError::Io when fill_buf failed with
ErrorKind::Interrupted, so a signal that arrived during a blocking read
of stdin ended the caller's session. It now retries the read, as
BufRead::read_until does. Other I/O errors are still returned.
process and process_legacy take two independent FnMut closures, so a
server whose requests and notifications update the same session must
wrap it in a RefCell, or record notifications and replay them after the
call without their params.
The new Handler trait has request and notification methods that both
take &mut self. process_with and process_legacy_with dispatch to one
Handler, with the same envelope, batch and limit behavior as process and
process_legacy, which now call them. Existing callers are unchanged.
ParseError::rpc_error and ParseError::error_response turn a failure
from parse_json or process into a response with a null ID: -32700
"Parse error" for invalid JSON, and -32600 with the limit message for a
message or batch over its limit. RpcError also implements
From<ParseError>.