Sign in

    daqing/moonway/cache does not have a README file

    Decoded

    pub(all) enum Decoded {
    Complete(RespValue, Int)
    Incomplete
    Malformed(String)
    } derive(Eq,
    Debug
    )

    Outcome of trying to decode one reply from a buffer.

    Decoded::equal

    fn Decoded::equal(Decoded, Decoded) -> Bool

    Decoded::not_equal

    fn Decoded::not_equal(x : Decoded, y : Decoded) -> Bool

    Decoded::to_repr

    RedisClient

    pub struct RedisClient {
    conn :
    Tcp

    buffer : Bytes
    }

    A connection to a Redis server over the async runtime's TCP.

    RedisClient::cache_get

    async fn RedisClient::cache_get(self : RedisClient, key : String) -> String?

    RedisClient::cache_set_ex

    async fn RedisClient::cache_set_ex(self : RedisClient, key : String, value : String, ttl : Int) -> Bool

    RedisClient::close

    fn RedisClient::close(self : RedisClient) -> Unit

    Close the underlying connection.

    RedisClient::command

    async fn RedisClient::command(self : RedisClient, args : Array[String]) -> RespValue

    Run one command and return its reply. Redis error replies (-ERR ...) and transport problems (connection closed, malformed reply) raise Failure; callers decide how to degrade (see the cache middleware).

    RedisClient::connect

    async fn RedisClient::connect(addr : String) -> RedisClient

    Connect to a Redis server at host:port (e.g. "127.0.0.1:6379"). Raises when the address cannot be parsed or the connection fails.

    RedisClient::del

    async fn RedisClient::del(self : RedisClient, key : String) -> Int

    DEL a key; returns the number of keys removed.

    RedisClient::expire

    async fn RedisClient::expire(self : RedisClient, key : String, ttl_seconds : Int) -> Bool

    EXPIRE a key in seconds; false when the key does not exist.

    RedisClient::get

    async fn RedisClient::get(self : RedisClient, key : String) -> String?

    GET a string value; Bulk(None) maps to None.

    RedisClient::ping

    async fn RedisClient::ping(self : RedisClient) -> Bool

    PING. Returns true on the expected PONG reply.

    RedisClient::set

    async fn RedisClient::set(self : RedisClient, key : String, value : String) -> Bool

    SET a string value. Returns true on OK.

    RedisClient::set_ex

    async fn RedisClient::set_ex(self : RedisClient, key : String, value : String, ttl_seconds : Int) -> Bool

    SET with an expiry in seconds.

    RespValue

    pub(all) enum RespValue {
    Simple(String)
    Error(String)
    Integer(Int64)
    Bulk(String?)
    Array(Array[RespValue])
    } derive(Eq,
    Debug
    )

    A decoded RESP2 reply.

    RespValue::equal

    fn RespValue::equal(RespValue, RespValue) -> Bool

    RespValue::not_equal

    fn RespValue::not_equal(x : RespValue, y : RespValue) -> Bool

    decode

    fn decode(buf : Bytes) -> Decoded

    Try to decode a single RESP2 reply from the front of buf.

    encode_command

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

    Encode a command as an array of bulk strings (the client request format).

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io