Skip to main content

Module codec

Module codec 

Source
Expand description

Async RESP3 codec — state machine mirroring the blocking [kevy_resp_client::RespClient] but with async IO.

Reuses kevy_resp::{encode_command, parse_reply} for the pure parse / encode logic so the wire format never has two implementations. What’s different here is the IO loop: instead of blocking Read::read we drive the codec on top of any AsyncTransport.

The state machine is identical to blocking:

  1. encode_command(args)write_all over the transport.
  2. Loop: parse_reply(&buf); on None await one read chunk and extend buf; on Some((reply, used)) drain used and return.

No buffered allocations beyond what blocking does (one growable buf for partial replies + one boxed chunk for reads). Pipelining reuses this same codec — run_pipeline writes N commands in one batch and reads N replies in sequence (T4.16).

Structs§

AsyncRespCodec
Buffered RESP3 codec over an AsyncTransport.