Expand description
Tokio-async codec gluing framing + jsonrpc onto
AsyncBufRead / AsyncWrite. One read_message /
write_message per LSP message.
§Read protocol (per message)
- Read header lines (CRLF-terminated, ASCII) until the empty
\r\nterminator. - Parse header block via
crate::framing::parse_header_block. - Read exactly
content_lengthbody bytes. - Decode body as one
crate::jsonrpc::Message.
§Write protocol (per message)
- JSON-encode the body (one allocation).
- Write
Content-Length: N\r\n\r\nheader. - Write the body. Flush.
§Cancellation safety
Both read_message and write_message are cancel-safe at
.await points only when the caller holds an exclusive
reference. We don’t promise mid-message resumption – the
actor wraps these in a single-task loop with no concurrent
readers.
Structs§
Enums§
- Codec
Error - Combined error surface for the codec layer.