RESP Protocol
The project uses the RESP (REdis Serialization Protocol) to encode and decode data between clients and the server. This protocol is lightweight, efficient, and easy to parse.
Each RESP type maps directly to a variant in your internalRedisValue
enum:
Starts with +. Used for success messages.
+OK\r\n
Starts with $. Used for binary-safe strings like keys and values.
$5\r\nhello\r\n
Starts with :. Used for numeric replies, like result counts.
:100\r\n
Starts with *. Represents a list of values (can be mixed types).
*3\r\n$3\r\nSET\r\n$4\r\nname\r\n$5\r\nAlice\r\n
Each command received from the client is decoded into aVec<RedisValue>
and processed. The server responds by encoding the result back into a RESP message before sending it.
Future support for RESP3 and additional data types (Null, Error types) may be added as the system evolves.