unmbt/ciallo-redis/resp does not have a README file

    RespDecoder

    pub struct RespDecoder {
    // private fields
    }

    流式增量 RESP 解码器(处理任意 TCP 拆包/粘包边界)

    RespDecoder::RespDecoder

    fn RespDecoder::RespDecoder() -> RespDecoder

    RespDecoder::feed

    fn RespDecoder::feed(self : RespDecoder, chunk : BytesView) -> Unit

    RespDecoder::next_frame

    RespValue

    pub(all) enum RespValue {
    SimpleString(String)
    SimpleError(String)
    Integer(Int64)
    BulkString(Bytes)
    Null
    Array(Array[RespValue])
    Boolean(Bool)
    Double(Double)
    Map(Array[(RespValue, RespValue)])
    Set(Array[RespValue])
    Push(Array[RespValue])
    } derive(Eq,
    Debug
    )

    RESP2 / RESP3 协议值 ADT(四目标纯核)

    decode_resp

    fn decode_resp(buf : BytesView) -> (RespValue, Int)? raise
    DataError

    增量解码单帧 RESP2/3 值:字节不足返回 None,成功返回 Some((值, 消费字节数))

    encode_command

    fn encode_command(args : Array[Bytes]) -> Bytes

    将命令参数列表编码为标准 RESP Bulk Array(如 *2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n)

    encode_value

    fn encode_value(value : RespValue) -> Bytes

    将任意 RespValue 编码为 RESP2/3 线格式字节流(用于客户端与 Mock Server 测试)

    Source Files