moonredis

    A Redis client for MoonBit: RESP2 and RESP3, pipelines, transactions, pub/sub, cluster and sentinel.

    redis
    client
    resp
    resp2
    resp3
    pipeline
    transaction
    pubsub
    pub-sub
    cluster
    redis-cluster
    sentinel
    cache
    key-value
    service-discovery
    json
    jsonpath
    redisjson
    redisearch
    full-text-search
    vector-search
    knn
    timeseries
    bloom-filter
    cuckoo-filter
    count-min-sketch
    top-k
    t-digest
    moonbit
    Download zip
    Version
    0.1.5
    License
    Apache-2.0
    Last updated
    3 hours ago
    Downloads
    249

    #moonredis

    A Redis client for MoonBit. It speaks RESP2 and RESP3, covers the command families, and carries the pieces a real deployment needs: a connection pool, retries, TLS, ACL auth, pipelines, transactions, pub/sub (including sharded), client-side caching, cluster routing and sentinel discovery. The protocol and command surface build on every backend; the socket transport runs on native and wasm.

    #Install

    moon add moonbitstack/moonredis

    moon.mod gains moonbitstack/moonredis. The protocol codec is the moonredis/resp package; the client, its command surface and the routing pieces are the root moonredis package; the socket transport is moonredis/socket.

    #Quick start

    async fn main {
    let options = @moonredis.ClientOptions::at("127.0.0.1", 6379)
    let conn = @socket.Connection::connect(options) catch {
    _ => return
    }
    let client = @moonredis.Client::new(conn)
    let _ = client.set("greeting", "hello")
    match client.get("greeting") {
    Some(bytes) => println(@utf8.decode_lossy(bytes[:]))
    None => println("(nil)")
    }
    }

    Connection::connect dials, negotiates the protocol with HELLO, authenticates with AUTH when credentials are set, SELECTs the database, and turns on CLIENT TRACKING when asked. A Client wraps any RedisConn; FakeConn is an in-memory one for tests.

    #Interface

    #Client and connection

    ItemPurpose
    ClientThe command surface: one async method per redis command, named as in redis-py.
    Client::new(&RedisConn)A client over a connection.
    Client::command(Array[Bytes])Send a raw command (binary-safe), returning the reply value.
    RedisConn (open trait)The transport contract: execute(Array[Bytes]) -> RespValue, and execute_all for several commands in one round trip, which defaults to sending them one at a time.
    FakeConnA scripted in-memory connection for tests (new, handler).
    RedisErrorReply(msg) for a redis error, Connection(msg), Closed, Protocol(msg), and Aborted for a transaction a watched key changed under.

    #Configuration

    ItemPurpose
    ClientOptionsEndpoint, credentials, protocol, timeouts, and the pool/retry/tracking policies.
    ClientOptions::at(host, port)Options at an address over the standard defaults.
    ClientOptions::with_auth(username, password), with_db(db)Copies with auth or database set.
    client_default, pool_default, retry_default, tracking_defaultThe market-standard presets.
    ProtocolResp2 or Resp3 (the default).
    PoolOptionsmax_idle, max_active, min_idle, idle_timeout, health_check.
    RetryOptionsattempts, base_delay, max_delay, level, jitter.
    TrackingOptionsenabled, bcast, optin, optout, noloop, redirect.
    backoff_delay(attempt, retry)The wait before a retry.

    #Batching and routing

    ItemPurpose
    PipelineQueue commands (add) and send them in one round trip (execute); multi wraps them in MULTI/EXEC.
    Client::watch, Client::unwatch, Client::discardTransaction control.
    ClusterTopologyA slot-to-node map; node_for_slot(slot).
    ClusterSlot, ClusterSlot::newA slot range owned by a node.
    ClusterClientRoutes a command to the node owning its key and follows MOVED and ASK, up to limit (redirect_limit, 3). dial opens nodes it was not built with.
    Redirect, redirect(msg)Moved or Ask with the slot and node, read from an error reply.
    ClusterTopology::assign(slot, node)Record where a slot lives.
    crc16(bytes), hash_slot(key), same_slot(keys)Slot hashing, honouring {hash tags}.
    decode_cluster_slots(reply)Parse a CLUSTER SLOTS reply into a ClusterTopology.
    SentinelClientResolve a master address through a list of sentinels.
    RetryConn, should_retry(error, attempt, retry)A retrying view of any connection; dial opens a new one after a failure and wait sleeps for the backoff.

    #Pub/sub and values

    ItemPurpose
    MessageA pub/sub frame: kind, channel, payload, pattern, count.
    Message::parse(value)Parse a RESP2 array or RESP3 push frame into a Message.
    StreamEntryOne stream entry: id and fields.
    PendingSummaryThe XPENDING summary: count, min_id, max_id, consumers.

    #Socket transport (moonredis/socket, native and wasm)

    ItemPurpose
    ConnectionA real connection over TCP or TLS; implements RedisConn.
    Connection::connect(options)Dial and negotiate from ClientOptions.
    Connection::take_pushes()Push frames read since the last command, such as the invalidations CLIENT TRACKING sends.
    connect_retrying(options)A RetryConn that reconnects under options.retry. Only for commands that are safe to send twice.
    PoolReuse idle connections (get, put, idle_count), bounded by max_idle.
    Subscriptionsubscribe/unsubscribe and next for Message frames; pattern and shard select PSUBSCRIBE and SSUBSCRIBE.

    #Codec (moonredis/resp)

    ItemPurpose
    RespValueEvery RESP2/RESP3 value: simple string, error, integer, bulk string, null, array, boolean, double, big number, bulk error, verbatim string, map, set, push.
    RespValue::decode(bytes), encode()Decode one value (or encode it back).
    RespReaderStream a sequence of values (read, at_end, rest).
    resp_encode_command(args), resp_command(args)Frame a command as an array of bulk strings.
    resp_kind(value)A value's type name, for diagnostics.

    The command methods also expose the small builders and decoders they use — arg_string, arg_int, arg_int64, arg_double, arg_bytes, push_some; expect_int64, expect_bool, expect_bytes, expect_string, expect_string_value, expect_array, expect_double, expect_map; status_ok — so a caller can compose a command or decode a reply by hand.

    #Commands

    One async method per command, named as in redis-py. Two helpers where MoonBit needs a name that redis uses as a keyword: type_ for TYPE and move_ for MOVE.

    FamilyMethods
    Stringset, set_get, setnx, setex, psetex, get, mget, mset, append, strlen, incr, incrby, decr, decrby, getrange, setrange, getdel, getex
    Keydel, unlink, exists, expire, pexpire, expireat, pexpireat, persist, ttl, pttl, type_, rename, renamenx, randomkey, touch, move_, copy, keys, scan, object_encoding, object_refcount, object_idletime, dump, restore
    Hashhset, hsetnx, hmset, hget, hmget, hgetall, hdel, hexists, hlen, hstrlen, hincrby, hincrbyfloat, hkeys, hvals, hscan, hrandfield
    Listlpush, rpush, lpushx, rpushx, lpop, lpopn, rpop, rpopn, llen, lindex, lrange, lset, lrem, linsert, ltrim, rpoplpush, lmove, blpop, brpop, brpoplpush, blmove
    Setsadd, srem, smembers, sismember, scard, spop, spopn, srandmember, srandmembern, sinter, sunion, sdiff, sinterstore, sunionstore, sdiffstore, smove, sscan
    Sorted setzadd, zrem, zscore, zmscore, zincrby, zcard, zrank, zrevrank, zrange, zrange_scores, zrevrange, zrevrange_scores, zrangebyscore, zrangebyscore_scores, zrevrangebyscore, zrevrangebyscore_scores, zcount, zremrangebyrank, zremrangebyscore, zpopmin, zpopmax, zunionstore, zinterstore, zscan, zrandmember, bzpopmin, bzpopmax
    Streamxadd, xlen, xdel, xtrim, xrange, xrevrange, xread, xack, xgroup_create, xgroup_destroy, xgroup_createconsumer, xgroup_delconsumer, xreadgroup, xpending
    HyperLogLogpfadd, pfcount, pfmerge
    Geogeoadd, geodist, geohash, geopos, geosearch
    Bitmapsetbit, getbit, bitcount, bitpos, bitop
    Script / functionScript runs a script by digest and reloads it when the server forgets; eval, evalsha, script_load, script_exists, script_flush, function_load, function_call, function_flush, function_delete
    Pub/subpublish, spublish, subscribe, unsubscribe, psubscribe, punsubscribe, ssubscribe, sunsubscribe
    Server / connectionping, ping_message, echo, select, auth, auth_user, info, dbsize, flushdb, flushall, swapdb, time_, lastsave, save, bgsave, bgrewriteaof, shutdown, config_get, config_set, config_rewrite, config_resetstat, client_setname, client_getname, client_id, client_kill, command_count, slowlog_get, slowlog_len, slowlog_reset, replicaof, replicaof_noone
    JSONjson_set, json_mset, json_merge, json_get, json_get_text, json_mget, json_del, json_forget, json_type, json_numincrby, json_nummultby, json_strappend, json_strlen, json_arrlen, json_arrindex, json_arrappend, json_arrinsert, json_arrpop, json_arrtrim, json_objkeys, json_objlen, json_toggle, json_clear, json_resp, json_debug_memory
    Searchft_create, ft_alter, ft_dropindex, ft_list, ft_aliasadd, ft_aliasupdate, ft_aliasdel, ft_search, ft_aggregate, ft_cursor_read, ft_cursor_del, ft_info, ft_explain, ft_explaincli, ft_profile, ft_tagvals, ft_spellcheck, ft_dictadd, ft_dictdel, ft_dictdump, ft_synupdate, ft_syndump, ft_sugadd, ft_sugget, ft_sugget_scored, ft_suglen, ft_sugdel, ft_config_get, ft_config_set, ft_hybrid
    Time seriests_create, ts_alter, ts_add, ts_madd, ts_incrby, ts_decrby, ts_del, ts_createrule, ts_deleterule, ts_range, ts_revrange, ts_mrange, ts_mrevrange, ts_get, ts_mget, ts_read, ts_nrange, ts_nrevrange, ts_info, ts_queryindex, ts_querylabels, ts_querylabel_values
    Bloom and cuckoo filtersbf_reserve, bf_add, bf_madd, bf_insert, bf_exists, bf_mexists, bf_scandump, bf_loadchunk, bf_info, bf_card, cf_reserve, cf_add, cf_addnx, cf_insert, cf_insertnx, cf_exists, cf_mexists, cf_del, cf_count, cf_scandump, cf_loadchunk, cf_info
    Counting sketchescms_initbydim, cms_initbyprob, cms_incrby, cms_query, cms_merge, cms_info, topk_reserve, topk_add, topk_incrby, topk_query, topk_count, topk_list, topk_list_with_count, topk_info, tdigest_create, tdigest_reset, tdigest_add, tdigest_merge, tdigest_min, tdigest_max, tdigest_quantile, tdigest_cdf, tdigest_rank, tdigest_revrank, tdigest_byrank, tdigest_byrevrank, tdigest_trimmed_mean, tdigest_info

    #Redis 8 modules

    Redis 8 serves JSON documents, a search engine, time series and the probabilistic structures from the server itself, so one connection covers all of them. The methods keep the module's own command name, and replies are decoded into the types the module documents: a JSON value is a Json, a sample is a Sample, and a flag is a Bool whether the wire wrote 1 or #t.

    async fn store_and_read(client : @moonredis.Client) -> Unit raise @moonredis.RedisError {
    let text = "{\"title\":\"moon\",\"readings\":[1,2,3]}"
    let document = @json.parse(text) catch {
    _ => raise @moonredis.Protocol("the document is not JSON")
    }
    let _ = client.json_set("doc", "$", document)
    let grown = client.json_arrappend("doc", "$.readings", [@json.Json::number(4.0)])
    println(grown[0].unwrap().to_string()) // 4
    let title = client.json_get_text("doc", path="$.title")
    println(title.unwrap_or("")) // ["moon"]
    }

    An index is a Schema: the documents it reads, and the fields it indexes. A field carries its own options, including a VectorSpec for a vector field.

    async fn index_books(client : @moonredis.Client) -> Unit raise @moonredis.RedisError {
    client.ft_create("books", {
    ..@moonredis.Schema::new([
    @moonredis.SchemaField::text("title", sortable=true),
    @moonredis.SchemaField::numeric("pages", sortable=true),
    @moonredis.SchemaField::vector("vec", @moonredis.VectorSpec::hnsw(4)),
    ]),
    prefixes: ["book:"],
    })
    let found = client.ft_search("books", "moon", options={
    ..@moonredis.search_default,
    sort_by: Some({ field: "pages", ascending: true }),
    return_fields: ["title"],
    limit: 10,
    })
    for hit in found.hits {
    println(hit.id + " " + hit.field("title").unwrap_or(""))
    }
    }

    ft_search answers a SearchResult — the total, the hits, and any warning — and ft_aggregate answers rows of named values. Both accept params, so a vector or a numeric bound can be passed out of band. ft_info and the module *_info methods answer either a typed record (IndexInfo, TsInfo) or an Info, a name-to-value map that reads the same under either protocol. FT.PROFILE hands back the protocol's own nesting: it is a diagnostic, not a value with a shape the client can promise.

    #Pipelines and transactions

    async fn counter(conn : &@moonredis.RedisConn) -> Unit raise @moonredis.RedisError {
    let pipeline = @moonredis.Pipeline::new(conn)
    pipeline.add([b"SET", b"a", b"1"])
    pipeline.add([b"INCR", b"a"])
    let replies = pipeline.execute() // [OK, 2]
    println(replies.length())
    }

    Call pipeline.multi() before execute to wrap the queued commands in MULTI/EXEC, so redis runs them atomically. Client::watch/unwatch/discard are available for optimistic locking around a transaction: when a watched key changes first, execute raises Aborted and nothing ran. An error reply inside a plain pipeline is one reply among the others.

    #Pub/sub

    async fn listen(
    conn : @socket.Connection,
    publisher : @moonredis.Client,
    ) -> Unit raise @moonredis.RedisError {
    let sub = @socket.Subscription::subscribe(conn, ["news"])
    let _ = publisher.publish("news", "hello")
    match sub.next() {
    Some(message) => println(message.channel + ": " + @utf8.decode_lossy(message.payload[:]))
    None => ()
    }
    }

    ssubscribe/spublish are the sharded forms, routed to one cluster shard.

    #Cluster and sentinel

    ClusterClient routes each command to the node owning the key's slot (from hash_slot/crc16, honouring {hash tags}) and follows a MOVED/ASK redirect once. ClusterTopology comes from decode_cluster_slots, and same_slot checks that a multi-key command's keys colocate. SentinelClient resolves a master address by asking sentinels in turn.

    #Service discovery

    moonredis/sd implements the moonsd contract on Redis. An endpoint is a key that expires, so an instance that stops renewing leaves by itself. Redis reports expiry only on a best-effort channel, so a watcher reads the service again every poll milliseconds.

    async fn serve_and_find(client : @moonredis.Client) -> Unit raise {
    let registry = @sd.Registry::new(client)
    @async.with_task_group(group => {
    group.spawn_bg(() => @moonsd.hold(registry, "greeter", @moonsd.Endpoint::new("10.0.0.1", 12000)))
    let endpoints = registry.resolve("greeter")
    println(endpoints.length())
    })
    }

    Registry::new takes prefix, default moonsd, and poll, default 1000. Any number of tasks may share one registry. Give it a client of its own: its lock orders its own commands, not those of anything else on that connection. A service's keys share a hash tag, so they stay in one cluster slot.

    #Pool and retries

    @socket.Pool reuses idle connections up to PoolOptions.max_idle. RetryConn retries a transport failure up to RetryOptions.attempts, while a redis error reply surfaces immediately; backoff_delay/should_retry expose the policy.

    #Examples

    ExampleRun
    01-respmoon run src/examples/01-resp — the codec, no server.
    02-commandsmoon run src/examples/02-commands — typed commands against a fake.
    03-connectmoon run src/examples/03-connect --target native — a real connection.
    04-pipelinemoon run src/examples/04-pipeline --target native — one round trip, and a transaction that loses a race.
    05-pubsubmoon run src/examples/05-pubsub --target native — a pattern subscription.
    06-clustermoon run src/examples/06-cluster --target native — keys routed by slot.
    07-modulesmoon run src/examples/07-modules --target native — one command from each Redis 8 module.

    #Testing

    The codec and command surface are tested against FakeConn with no network, so they run on every backend. src/integration runs every command family against a real server under both protocols, and covers transactions losing a race, redirects, a slot migrating, a failover and a connection killed underneath. The module families are checked command by command, against the values the server returns rather than against "it did not raise". scripts/start_redis.sh starts what those tests connect to: a standalone redis 8, a six-node cluster, and a master and replica under a sentinel, all from the redis:8 image when docker is present, since that image carries the JSON, search, time series and probabilistic modules. Without servers the tests return early; with MOONREDIS_LIVE set, as in CI, a missing server fails them.

    #Licence

    Apache-2.0.

    RedisConn

    pub(open) trait RedisConn {
    async fn execute(Self, Array[Bytes]) ->
    RespValue
    raise RedisError
    async fn execute_all(Self, Array[Array[Bytes]]) -> Array[
    RespValue
    ] raise RedisError = _
    }

    A live redis connection: it sends an encoded command (an array of argument byte strings) and returns the decoded reply. Implementations own the transport — a real socket speaking RESP, or an in-memory fake. It is open and async so a socket can be one: real redis I/O suspends, and a sealed synchronous trait left every implementation a test double.

    RedisError

    pub(all) suberror RedisError {
    Reply(String)
    Connection(String)
    Protocol(String)
    Closed
    Aborted
    } derive(Eq,
    Debug
    )

    Why a redis call failed: a redis error reply, a transport failure, a closed connection, a reply the client could not interpret as the command promised, or a transaction a watched key changed under.

    RedisError::equal

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

    RedisError::not_equal

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

    AggregateOptions

    pub(all) struct AggregateOptions {
    verbatim : Bool
    load : Array[String]
    group_by : Array[String]
    reducers : Array[Reducer]
    apply : Array[(String, String)]
    sort_by : Array[SortKey]
    offset : Int64
    limit : Int64
    filter : String?
    params : Array[(String, Bytes)]
    dialect : Int?
    timeout : Int64?
    cursor_count : Int64?
    max_idle : Int64?
    }

    The options FT.AGGREGATE takes besides the index and the query.

    AggregateResult

    pub(all) struct AggregateResult {
    total : Int64
    rows : Array[Array[(String, FieldValue)]]
    cursor : Int64?
    }

    What FT.AGGREGATE and FT.CURSOR READ answer: the rows, and the cursor id to read more with.

    Client

    pub struct Client {
    conn : &RedisConn
    }

    A redis client over a RedisConn: the typed command families are methods on it, and command is the general entry when a caller wants to send raw argument bytes.

    Client::append

    async fn Client::append(self : Client, key : String, value : String) -> Int64 raise RedisError

    APPEND key value: append value to key, returning the new length in bytes.

    Client::auth

    async fn Client::auth(self : Client, password : String) -> Unit raise RedisError

    AUTH password: authenticate with the default user.

    Client::auth_user

    async fn Client::auth_user(self : Client, username : String, password : String) -> Unit raise RedisError

    AUTH user password: authenticate with a named ACL account.

    Client::bf_add

    async fn Client::bf_add(self : Client, key : String, item : String) -> Bool raise RedisError

    BF.ADD key item: add an item, returning whether the filter changed — false when it probably held the item already.

    Client::bf_card

    async fn Client::bf_card(self : Client, key : String) -> Int64 raise RedisError

    BF.CARD key: how many items were added, duplicates included.

    Client::bf_exists

    async fn Client::bf_exists(self : Client, key : String, item : String) -> Bool raise RedisError

    BF.EXISTS key item: whether the filter probably holds the item.

    Client::bf_info

    async fn Client::bf_info(self : Client, key : String) -> Info raise RedisError

    BF.INFO key: capacity, memory and item counts.

    Client::bf_insert

    async fn Client::bf_insert(self : Client, key : String, items : Array[String], capacity? : Int64, error_rate? : Double, expansion? : Int64, nocreate? : Bool, nonscaling? : Bool) -> Array[Bool] raise RedisError

    BF.INSERT key [CAPACITY n] [ERROR rate] [EXPANSION n] [NOCREATE] [NONSCALING] ITEMSitem...: add items, creating the filter from these parameters when it does not exist.

    Client::bf_loadchunk

    async fn Client::bf_loadchunk(self : Client, key : String, iterator : Int64, data : Bytes) -> Unit raise RedisError

    BF.LOADCHUNK key iterator data: restore one chunk of a serialized filter.

    Client::bf_madd

    async fn Client::bf_madd(self : Client, key : String, items : Array[String]) -> Array[Bool] raise RedisError

    BF.MADD key item [item ...]: add items, one flag each.

    Client::bf_mexists

    async fn Client::bf_mexists(self : Client, key : String, items : Array[String]) -> Array[Bool] raise RedisError

    BF.MEXISTS key item [item ...]: one answer per item.

    Client::bf_reserve

    async fn Client::bf_reserve(self : Client, key : String, error_rate : Double, capacity : Int64, expansion? : Int64, nonscaling? : Bool) -> Unit raise RedisError

    BF.RESERVE key error_rate capacity [EXPANSION expansion] [NONSCALING]: create a Bloom filter sized for capacity items at error_rate false positives. A filter that grows keeps its rate by adding sub-filters of expansion times the capacity; nonscaling fixes it at the initial size and starts refusing items when full.

    Client::bf_scandump

    async fn Client::bf_scandump(self : Client, key : String, iterator : Int64) -> (Int64, Bytes?) raise RedisError

    BF.SCANDUMP key iterator: the next chunk of a serialized filter, and the iterator to ask for the one after it. Iteration ends when the iterator comes back as 0.

    Client::bgrewriteaof

    async fn Client::bgrewriteaof(self : Client) -> String raise RedisError

    BGREWRITEAOF: start a background rewrite of the append-only file.

    Client::bgsave

    async fn Client::bgsave(self : Client) -> String raise RedisError

    BGSAVE: start a background save, returning the status line.

    Client::bitcount

    async fn Client::bitcount(self : Client, key : String, start? : Int, end? : Int) -> Int64 raise RedisError

    BITCOUNT key [start end]: the number of set bits, optionally within a byte range.

    Client::bitop

    async fn Client::bitop(self : Client, op : String, destination : String, keys : Array[String]) -> Int64 raise RedisError

    BITOP op dest key...: store the bitwise AND/OR/XOR of the keys, or the NOT of a single key, in dest, returning the result length in bytes.

    Client::bitpos

    async fn Client::bitpos(self : Client, key : String, bit : Int, start? : Int, end? : Int) -> Int64 raise RedisError

    BITPOS key bit [start end]: the first bit equal to bit (0 or 1), optionally within a byte range. -1 if none is found.

    Client::blmove

    async fn Client::blmove(self : Client, source : String, destination : String, wherefrom : String, whereto : String, timeout : Int) -> Bytes? raise RedisError

    BLMOVE source destination wherefrom whereto timeout: blocking LMOVE.

    Client::blpop

    async fn Client::blpop(self : Client, keys : Array[String], timeout : Int) -> (String, Bytes)? raise RedisError

    BLPOP key... timeout: blocking pop of the first available head element across the given keys, waiting up to timeout seconds (0 = forever). Returns the key and value, or None on timeout.

    Client::brpop

    async fn Client::brpop(self : Client, keys : Array[String], timeout : Int) -> (String, Bytes)? raise RedisError

    BRPOP key... timeout: blocking pop of the first available tail element across the given keys. Returns the key and value, or None on timeout.

    Client::brpoplpush

    async fn Client::brpoplpush(self : Client, source : String, destination : String, timeout : Int) -> Bytes? raise RedisError

    BRPOPLPUSH source destination timeout: blocking RPOPLPUSH.

    Client::bzpopmax

    async fn Client::bzpopmax(self : Client, keys : Array[String], timeout : Int) -> (String, String, Double)? raise RedisError

    BZPOPMAX key... timeout: blocking pop of the highest-scoring member across keys.

    Client::bzpopmin

    async fn Client::bzpopmin(self : Client, keys : Array[String], timeout : Int) -> (String, String, Double)? raise RedisError

    BZPOPMIN key... timeout: blocking pop of the lowest-scoring member across keys. Returns (key, member, score), or None on timeout.

    Client::cf_add

    async fn Client::cf_add(self : Client, key : String, item : String) -> Bool raise RedisError

    CF.ADD key item: add an item, returning whether it was added.

    Client::cf_addnx

    async fn Client::cf_addnx(self : Client, key : String, item : String) -> Bool raise RedisError

    CF.ADDNX key item: add an item only if the filter does not hold it yet.

    Client::cf_count

    async fn Client::cf_count(self : Client, key : String, item : String) -> Int64 raise RedisError

    CF.COUNT key item: how many times the item was added.

    Client::cf_del

    async fn Client::cf_del(self : Client, key : String, item : String) -> Bool raise RedisError

    CF.DEL key item: remove one occurrence of an item. True if it was there.

    Client::cf_exists

    async fn Client::cf_exists(self : Client, key : String, item : String) -> Bool raise RedisError

    CF.EXISTS key item: whether the filter probably holds the item.

    Client::cf_info

    async fn Client::cf_info(self : Client, key : String) -> Info raise RedisError

    CF.INFO key: size, buckets and item counts.

    Client::cf_insert

    async fn Client::cf_insert(self : Client, key : String, items : Array[String], capacity? : Int64, nocreate? : Bool) -> Array[Bool] raise RedisError

    CF.INSERT key [CAPACITY n] [NOCREATE] ITEMS item...: add items, creating the filter when it does not exist.

    Client::cf_insertnx

    async fn Client::cf_insertnx(self : Client, key : String, items : Array[String], capacity? : Int64, nocreate? : Bool) -> Array[Bool] raise RedisError

    CF.INSERTNX key [CAPACITY n] [NOCREATE] ITEMS item...: add the items the filter does not hold yet.

    Client::cf_loadchunk

    async fn Client::cf_loadchunk(self : Client, key : String, iterator : Int64, data : Bytes) -> Unit raise RedisError

    CF.LOADCHUNK key iterator data: restore one chunk of a serialized filter.

    Client::cf_mexists

    async fn Client::cf_mexists(self : Client, key : String, items : Array[String]) -> Array[Bool] raise RedisError

    CF.MEXISTS key item [item ...]: one answer per item.

    Client::cf_reserve

    async fn Client::cf_reserve(self : Client, key : String, capacity : Int64, bucket_size? : Int64, max_iterations? : Int64, expansion? : Int64) -> Unit raise RedisError

    CF.RESERVE key capacity [BUCKETSIZE n] [MAXITERATIONS n] [EXPANSION n]: create a cuckoo filter for capacity items.

    Client::cf_scandump

    async fn Client::cf_scandump(self : Client, key : String, iterator : Int64) -> (Int64, Bytes?) raise RedisError

    CF.SCANDUMP key iterator: the next chunk of a serialized filter, and the iterator for the one after it.

    Client::client_getname

    async fn Client::client_getname(self : Client) -> String? raise RedisError

    CLIENT GETNAME: this connection's name, or None if unset.

    Client::client_id

    async fn Client::client_id(self : Client) -> Int64 raise RedisError

    CLIENT ID: this connection's numeric id.

    Client::client_kill

    async fn Client::client_kill(self : Client, filters : Array[String]) -> Int64 raise RedisError

    CLIENT KILL [ID id] [ADDR host:port] [TYPE ...] [SKIPME yes/no]: close matching client connections.

    Client::client_setname

    async fn Client::client_setname(self : Client, name : String) -> Unit raise RedisError

    CLIENT SETNAME name: label this connection in CLIENT LIST.

    Client::cluster_slots

    CLUSTER SLOTS: the cluster's slot map, as the raw reply (each caller decodes it).

    Client::cms_incrby

    async fn Client::cms_incrby(self : Client, key : String, items : Array[(String, Int64)]) -> Array[Int64] raise RedisError

    CMS.INCRBY key item increment [item increment ...]: add to the counts, returning the new count of each item.

    Client::cms_info

    async fn Client::cms_info(self : Client, key : String) -> Info raise RedisError

    CMS.INFO key: width, depth and total count.

    Client::cms_initbydim

    async fn Client::cms_initbydim(self : Client, key : String, width : Int64, depth : Int64) -> Unit raise RedisError

    CMS.INITBYDIM key width depth: create a count-min sketch of width counters per row and depth rows. The error is about 1/width of the total count, the failure probability about 1/2^depth.

    Client::cms_initbyprob

    async fn Client::cms_initbyprob(self : Client, key : String, error_rate : Double, probability : Double) -> Unit raise RedisError

    CMS.INITBYPROB key error probability: create a count-min sketch from the error it may make relative to the total count, and the probability of exceeding it.

    Client::cms_merge

    async fn Client::cms_merge(self : Client, destination : String, sources : Array[String], weights? : Array[Int64]) -> Unit raise RedisError

    CMS.MERGE destination numKeys source... [WEIGHTS w...]: add several sketches into destination, each scaled by its weight.

    Client::cms_query

    async fn Client::cms_query(self : Client, key : String, items : Array[String]) -> Array[Int64] raise RedisError

    CMS.QUERY key item [item ...]: the estimated count of each item.

    Client::command

    async fn Client::command(self : Client, args : Array[Bytes]) ->
    RespValue
    raise RedisError

    Send args as a command and return the reply, turning a redis error reply (-ERR or a bulk error) into RedisError::Reply. A transport failure raises from execute as a Connection or Closed error, unchanged.

    Client::command_count

    async fn Client::command_count(self : Client) -> Int64 raise RedisError

    COMMAND COUNT: the number of commands the server implements.

    Client::config_get

    async fn Client::config_get(self : Client, parameter : String) -> Array[(String, String)] raise RedisError

    CONFIG GET parameter: the current value(s) of a config parameter (which may match several via a glob), as alternating name/value pairs.

    Client::config_resetstat

    async fn Client::config_resetstat(self : Client) -> Unit raise RedisError

    CONFIG RESETSTAT: reset the server's statistics counters.

    Client::config_rewrite

    async fn Client::config_rewrite(self : Client) -> Unit raise RedisError

    CONFIG REWRITE: persist the running config to the config file.

    Client::config_set

    async fn Client::config_set(self : Client, parameter : String, value : String) -> Unit raise RedisError

    CONFIG SET parameter value: change a config parameter at runtime.

    Client::copy

    async fn Client::copy(self : Client, source : String, destination : String, db? : Int, replace? : Bool) -> Bool raise RedisError

    COPY source destination [DB n] [REPLACE]: copy source to destination. true if copied.

    Client::dbsize

    async fn Client::dbsize(self : Client) -> Int64 raise RedisError

    DBSIZE: the number of keys in the selected database.

    Client::decr

    async fn Client::decr(self : Client, key : String) -> Int64 raise RedisError

    DECR key: decrement key's integer value by 1, returning the result.

    Client::decrby

    async fn Client::decrby(self : Client, key : String, n : Int64) -> Int64 raise RedisError

    DECRBY key n: subtract n from key's integer value, returning the result.

    Client::del

    async fn Client::del(self : Client, keys : Array[String]) -> Int64 raise RedisError

    DEL key...: delete the given keys, returning how many existed.

    Client::discard

    async fn Client::discard(self : Client) -> Unit raise RedisError

    DISCARD: abort a transaction started with MULTI.

    Client::dump

    async fn Client::dump(self : Client, key : String) -> Bytes? raise RedisError

    DUMP key: serialise key's value to a binary dump, or None if the key is absent.

    Client::echo

    async fn Client::echo(self : Client, message : String) -> Bytes raise RedisError

    ECHO message: return message unchanged (a larger round-trip probe than PING).

    Client::eval

    async fn Client::eval(self : Client, script : String, keys : Array[String], args : Array[String]) ->
    RespValue
    raise RedisError

    EVAL script numkeys key... arg...: run script, declaring how many of the leading arguments are keys. Returns the script's (arbitrary) reply.

    Client::evalsha

    async fn Client::evalsha(self : Client, sha : String, keys : Array[String], args : Array[String]) ->
    RespValue
    raise RedisError

    EVALSHA sha numkeys key... arg...: run a script by its SCRIPT LOAD digest.

    Client::exists

    async fn Client::exists(self : Client, keys : Array[String]) -> Int64 raise RedisError

    EXISTS key...: the number of the given keys that exist.

    Client::expire

    async fn Client::expire(self : Client, key : String, seconds : Int64) -> Bool raise RedisError

    EXPIRE key secs: set a secs-second expiry on key. false if the key is absent.

    Client::expireat

    async fn Client::expireat(self : Client, key : String, timestamp : Int64) -> Bool raise RedisError

    EXPIREAT key ts: expire key at the given Unix second. false if the key is absent.

    Client::flushall

    async fn Client::flushall(self : Client, sync? : Bool) -> Unit raise RedisError

    FLUSHALL [ASYNC|SYNC]: delete every key in every database.

    Client::flushdb

    async fn Client::flushdb(self : Client, sync? : Bool) -> Unit raise RedisError

    FLUSHDB [ASYNC|SYNC]: delete every key in the selected database.

    Client::ft_aggregate

    async fn Client::ft_aggregate(self : Client, index : String, query : String, options? : AggregateOptions) -> AggregateResult raise RedisError

    FT.AGGREGATE index query [options]: run the pipeline of loads, groupings, applies, sorts and filters options describes over the matching documents.

    Client::ft_aliasadd

    async fn Client::ft_aliasadd(self : Client, alias_name : String, index : String) -> Unit raise RedisError

    FT.ALIASADD alias index: make alias another name for index.

    Client::ft_aliasdel

    async fn Client::ft_aliasdel(self : Client, alias_name : String) -> Unit raise RedisError

    FT.ALIASDEL alias: drop an alias.

    Client::ft_aliasupdate

    async fn Client::ft_aliasupdate(self : Client, alias_name : String, index : String) -> Unit raise RedisError

    FT.ALIASUPDATE alias index: point an existing alias at another index.

    Client::ft_alter

    async fn Client::ft_alter(self : Client, index : String, fields : Array[SchemaField], skip_initial_scan? : Bool) -> Unit raise RedisError

    FT.ALTER index [SKIPINITIALSCAN] SCHEMA ADD field...: add fields to a live index. skip_initial_scan leaves the documents already indexed unbackfilled.

    Client::ft_config_get

    async fn Client::ft_config_get(self : Client, pattern : String) -> Array[(String, String)] raise RedisError

    FT.CONFIG GET pattern: the settings whose names match.

    Client::ft_config_set

    async fn Client::ft_config_set(self : Client, name : String, value : String) -> Unit raise RedisError

    FT.CONFIG SET name value: change a search setting.

    Client::ft_create

    async fn Client::ft_create(self : Client, index : String, schema : Schema) -> Unit raise RedisError

    FT.CREATE index [ON HASH|JSON] [PREFIX n ...] [FILTER expr] [LANGUAGE l][LANGUAGE_FIELD f] [SCORE s] [SCORE_FIELD f] [TEMPORARY secs] [STOPWORDS n ...]SCHEMA field...: build an index over the documents schema describes.

    Client::ft_cursor_del

    async fn Client::ft_cursor_del(self : Client, index : String, cursor : Int64) -> Unit raise RedisError

    FT.CURSOR DEL index cursor: drop a cursor and the rows it still holds.

    Client::ft_cursor_read

    async fn Client::ft_cursor_read(self : Client, index : String, cursor : Int64, count? : Int64) -> AggregateResult raise RedisError

    FT.CURSOR READ index cursor [COUNT n]: the next page of an aggregation.

    Client::ft_dictadd

    async fn Client::ft_dictadd(self : Client, dictionary : String, terms : Array[String]) -> Int64 raise RedisError

    FT.DICTADD dictionary term [term ...]: add terms to a spelling dictionary, returning how many were new.

    Client::ft_dictdel

    async fn Client::ft_dictdel(self : Client, dictionary : String, terms : Array[String]) -> Int64 raise RedisError

    FT.DICTDEL dictionary term [term ...]: remove terms, returning how many existed.

    Client::ft_dictdump

    async fn Client::ft_dictdump(self : Client, dictionary : String) -> Array[String] raise RedisError

    FT.DICTDUMP dictionary: every term in a dictionary.

    Client::ft_dropindex

    async fn Client::ft_dropindex(self : Client, index : String, delete_documents? : Bool) -> Unit raise RedisError

    FT.DROPINDEX index [DD]: drop an index, and with delete_documents the documents it indexed.

    Client::ft_explain

    async fn Client::ft_explain(self : Client, index : String, query : String, dialect? : Int) -> String raise RedisError

    FT.EXPLAIN index query [DIALECT d]: the query as the engine interprets it.

    Client::ft_explaincli

    async fn Client::ft_explaincli(self : Client, index : String, query : String, dialect? : Int) -> Array[String] raise RedisError

    FT.EXPLAINCLI index query [DIALECT d]: the same, one line per node.

    Client::ft_hybrid

    async fn Client::ft_hybrid(self : Client, index : String, query : String, vector_field : String, vector : Bytes, options? : HybridOptions) -> SearchResult raise RedisError

    FT.HYBRID index SEARCH query VSIM @field $vector [KNN ...] [COMBINE ...] [LOAD ...][SORTBY ...] [LIMIT ...] [FILTER ...] PARAMS ...: rank documents by a text search and a vector search at once. vector is the query vector as the field's element type writes it, and vector_field the name of the schema field it is compared against.

    Client::ft_info

    async fn Client::ft_info(self : Client, index : String) -> IndexInfo raise RedisError

    FT.INFO index: the index's size, schema and settings.

    Client::ft_list

    async fn Client::ft_list(self : Client) -> Array[String] raise RedisError

    FT._LIST: the names of the indexes.

    Client::ft_profile

    async fn Client::ft_profile(self : Client, index : String, aggregate : Bool, query : String, limited? : Bool) ->
    RespValue
    raise RedisError

    FT.PROFILE index SEARCH|AGGREGATE [LIMITED] QUERY query: the ordinary reply and the timing breakdown beside it, as the protocol carries them. The second element is a nested profile whose shape the search engine documents, so it stays as it arrives.
    async fn Client::ft_search(self : Client, index : String, query : String, options? : SearchOptions) -> SearchResult raise RedisError

    FT.SEARCH index query [options]: the documents that match query, with the scoring, paging, sorting and projection options asks for.

    Client::ft_spellcheck

    async fn Client::ft_spellcheck(self : Client, index : String, query : String, distance? : Int, dialect? : Int) -> Array[SpellCheckTerm] raise RedisError

    FT.SPELLCHECK index query [DISTANCE d] [DIALECT d]: the query terms the index knows nothing about, and what it suggests instead.

    Client::ft_sugadd

    async fn Client::ft_sugadd(self : Client, key : String, suggestion : String, score : Double, increment? : Bool, payload? : String) -> Int64 raise RedisError

    FT.SUGADD key suggestion score [INCR] [PAYLOAD payload]: add a completion, returning how many suggestions the key holds.

    Client::ft_sugdel

    async fn Client::ft_sugdel(self : Client, key : String, suggestion : String) -> Bool raise RedisError

    FT.SUGDEL key suggestion: remove a completion. True if it was there.

    Client::ft_sugget

    async fn Client::ft_sugget(self : Client, key : String, prefix : String, fuzzy? : Bool, max? : Int64) -> Array[String] raise RedisError

    FT.SUGGET key prefix [FUZZY] [MAX n]: the completions starting with prefix.

    Client::ft_sugget_scored

    async fn Client::ft_sugget_scored(self : Client, key : String, prefix : String, fuzzy? : Bool, max? : Int64) -> Array[(String, Double)] raise RedisError

    FT.SUGGET key prefix WITHSCORES: the completions and their scores.

    Client::ft_suglen

    async fn Client::ft_suglen(self : Client, key : String) -> Int64 raise RedisError

    FT.SUGLEN key: how many completions a key holds.

    Client::ft_syndump

    async fn Client::ft_syndump(self : Client, index : String) -> Array[(String, Array[String])] raise RedisError

    FT.SYNDUMP index: each term that has synonyms, and the groups it belongs to.

    Client::ft_synupdate

    async fn Client::ft_synupdate(self : Client, index : String, group : String, terms : Array[String], skip_initial_scan? : Bool) -> Unit raise RedisError

    FT.SYNUPDATE index group [SKIPINITIALSCAN] term [term ...]: put the terms in one synonym group.

    Client::ft_tagvals

    async fn Client::ft_tagvals(self : Client, index : String, field : String) -> Array[String] raise RedisError

    FT.TAGVALS index field: the distinct values of a tag field.

    Client::function_call

    async fn Client::function_call(self : Client, function : String, keys : Array[String], args : Array[String]) ->
    RespValue
    raise RedisError

    FCALL function numkeys key... arg...: call a registered function.

    Client::function_delete

    async fn Client::function_delete(self : Client, name : String) -> Unit raise RedisError

    FUNCTION DELETE name: delete a function library by name.

    Client::function_flush

    async fn Client::function_flush(self : Client) -> Unit raise RedisError

    FUNCTION FLUSH: discard every registered function library.

    Client::function_load

    async fn Client::function_load(self : Client, code : String, replace? : Bool) -> String raise RedisError

    FUNCTION LOAD [REPLACE] code: register a functions library, returning its name.

    Client::geoadd

    async fn Client::geoadd(self : Client, key : String, points : Array[(String, Double, Double)]) -> Int64 raise RedisError

    GEOADD key longitude latitude member...: index the members, returning how many were new.

    Client::geodist

    async fn Client::geodist(self : Client, key : String, a : String, b : String, unit? : String) -> Double? raise RedisError

    GEODIST key a b [unit]: the distance between members a and b, or None if a member is absent. unit is one of m, km, mi, ft (metres by default).

    Client::geohash

    async fn Client::geohash(self : Client, key : String, members : Array[String]) -> Array[String?] raise RedisError

    GEOHASH key member...: the geohash string of each member, None where absent.

    Client::geopos

    async fn Client::geopos(self : Client, key : String, members : Array[String]) -> Array[(Double, Double)?] raise RedisError

    GEOPOS key member...: the [longitude, latitude] of each member, None where absent.

    Client::geosearch

    async fn Client::geosearch(self : Client, key : String, from_member? : String, longitude? : Double, latitude? : Double, radius? : Double, width? : Double, height? : Double, unit : String, count? : Int, asc? : Bool, desc? : Bool) -> Array[String] raise RedisError

    GEOSEARCH key [FROMMEMBER m] [FROMLONLAT lon lat] [BYRADIUS r unit] [BYBOX w h unit][COUNT n] [ASC|DESC]: the members matching a circular or rectangular area, optionally ordered and capped. Returns the member names.

    Client::get

    async fn Client::get(self : Client, key : String) -> Bytes? raise RedisError

    GET key: the value at key, or None if absent or expired.

    Client::getbit

    async fn Client::getbit(self : Client, key : String, offset : Int64) -> Int64 raise RedisError

    GETBIT key offset: the bit at offset (0 or 1).

    Client::getdel

    async fn Client::getdel(self : Client, key : String) -> Bytes? raise RedisError

    GETDEL key: return key's value and delete the key, or None if absent.

    Client::getex

    async fn Client::getex(self : Client, key : String, ex? : Int64, px? : Int64, exat? : Int64, pxat? : Int64, persist? : Bool) -> Bytes? raise RedisError

    GETEX key [EX secs] [PX ms] [EXAT secs] [PXAT ms] [PERSIST]: return key's value and apply or clear its expiry, or None if absent.

    Client::getrange

    async fn Client::getrange(self : Client, key : String, start : Int, end : Int) -> Bytes raise RedisError

    GETRANGE key start end: the substring of key from start to end (inclusive, negative from the end).

    Client::hdel

    async fn Client::hdel(self : Client, key : String, fields : Array[String]) -> Int64 raise RedisError

    HDEL key field...: delete the given fields, returning how many existed.

    Client::hexists

    async fn Client::hexists(self : Client, key : String, field : String) -> Bool raise RedisError

    HEXISTS key field: whether field exists in the hash.

    Client::hget

    async fn Client::hget(self : Client, key : String, field : String) -> Bytes? raise RedisError

    HGET key field: the value at field, or None if the key or field is absent.

    Client::hgetall

    async fn Client::hgetall(self : Client, key : String) -> Array[(String, String)] raise RedisError

    HGETALL key: every field/value pair as an array of alternating field, value.

    Client::hincrby

    async fn Client::hincrby(self : Client, key : String, field : String, n : Int64) -> Int64 raise RedisError

    HINCRBY key field n: add n to field's integer value, returning the result.

    Client::hincrbyfloat

    async fn Client::hincrbyfloat(self : Client, key : String, field : String, f : Double) -> Double raise RedisError

    HINCRBYFLOAT key field f: add f to field's value, returning the new value.

    Client::hkeys

    async fn Client::hkeys(self : Client, key : String) -> Array[String] raise RedisError

    HKEYS key: the field names of the hash.

    Client::hlen

    async fn Client::hlen(self : Client, key : String) -> Int64 raise RedisError

    HLEN key: the number of fields in the hash.

    Client::hmget

    async fn Client::hmget(self : Client, key : String, fields : Array[String]) -> Array[Bytes?] raise RedisError

    HMGET key field...: the value at each field, None where absent, in order.

    Client::hmset

    async fn Client::hmset(self : Client, key : String, fields : Array[(String, String)]) -> Unit raise RedisError

    HMSET key field value...: set several fields atomically. Deprecated in favour of HSET but kept for parity with redis-py.

    Client::hrandfield

    async fn Client::hrandfield(self : Client, key : String, count? : Int) -> Array[String] raise RedisError

    HRANDFIELD key [count] [WITHVALUES]: one or more random fields, optionally with their values.

    Client::hrandfield_values

    async fn Client::hrandfield_values(self : Client, key : String, count : Int) -> Array[(String, String)] raise RedisError

    HRANDFIELD key count WITHVALUES: random fields with their values. A negative count may repeat a field.

    Client::hscan

    async fn Client::hscan(self : Client, key : String, cursor : String, pattern? : String, count? : Int) -> (String, Array[(String, String)]) raise RedisError

    HSCAN key cursor [MATCH pattern] [COUNT n]: an incremental hash field scan. Returns the next cursor and the field/value pairs found this call.

    Client::hset

    async fn Client::hset(self : Client, key : String, fields : Array[(String, String)]) -> Int64 raise RedisError

    HSET key field value...: set one or more fields, returning the count of fields that were new.

    Client::hsetnx

    async fn Client::hsetnx(self : Client, key : String, field : String, value : String) -> Bool raise RedisError

    HSETNX key field value: set field only if absent. true if set.

    Client::hstrlen

    async fn Client::hstrlen(self : Client, key : String, field : String) -> Int64 raise RedisError

    HSTRLEN key field: the byte length of field's value (0 if absent).

    Client::hvals

    async fn Client::hvals(self : Client, key : String) -> Array[String] raise RedisError

    HVALS key: the values of the hash.

    Client::incr

    async fn Client::incr(self : Client, key : String) -> Int64 raise RedisError

    INCR key: increment key's integer value by 1, returning the result.

    Client::incrby

    async fn Client::incrby(self : Client, key : String, n : Int64) -> Int64 raise RedisError

    INCRBY key n: add n to key's integer value, returning the result.

    Client::info

    async fn Client::info(self : Client, section? : String) -> String raise RedisError

    INFO [section]: the server's key/value metrics, as the raw text block redis returns.

    Client::json_arrappend

    async fn Client::json_arrappend(self : Client, key : String, path : String, values : Array[
    Json
    ]) -> Array[Int64?] raise RedisError

    JSON.ARRAPPEND key path value [value ...]: append the values to each array at path, returning the new lengths.

    Client::json_arrindex

    async fn Client::json_arrindex(self : Client, key : String, path : String, value :
    Json
    , start? : Int64, stop? : Int64) -> Array[Int64?] raise RedisError

    JSON.ARRINDEX key path value [START start] [STOP stop]: the first position of value in each array at path, -1 when absent.

    Client::json_arrinsert

    async fn Client::json_arrinsert(self : Client, key : String, path : String, index : Int64, values : Array[
    Json
    ]) -> Array[Int64?] raise RedisError

    JSON.ARRINSERT key path index value [value ...]: insert the values at index in each array at path, returning the new lengths.

    Client::json_arrlen

    async fn Client::json_arrlen(self : Client, key : String, path? : String) -> Array[Int64?] raise RedisError

    JSON.ARRLEN key [path]: the length of each array at path.

    Client::json_arrpop

    async fn Client::json_arrpop(self : Client, key : String, path : String, index? : Int64) -> Array[
    Json
    ?] raise RedisError

    JSON.ARRPOP key [path] [index]: pop an element from each array at path, index -1 being the last, returning the popped values.

    Client::json_arrtrim

    async fn Client::json_arrtrim(self : Client, key : String, path : String, start : Int64, stop : Int64) -> Array[Int64?] raise RedisError

    JSON.ARRTRIM key path start stop: trim each array at path to the inclusive range, returning the new lengths.

    Client::json_clear

    async fn Client::json_clear(self : Client, key : String, path? : String) -> Int64 raise RedisError

    JSON.CLEAR key [path]: empty the arrays and objects at path, returning how many values were cleared.

    Client::json_debug_memory

    async fn Client::json_debug_memory(self : Client, key : String, path? : String) -> Int64 raise RedisError

    JSON.DEBUG MEMORY key [path]: the bytes the value at path occupies.

    Client::json_del

    async fn Client::json_del(self : Client, key : String, path? : String) -> Int64 raise RedisError

    JSON.DEL key [path]: delete the document or the part at path, returning how many values were removed.

    Client::json_forget

    async fn Client::json_forget(self : Client, key : String, path? : String) -> Int64 raise RedisError

    JSON.FORGET key [path]: the older name for JSON.DEL.

    Client::json_get

    async fn Client::json_get(self : Client, key : String, path? : String) ->
    Json
    ? raise RedisError

    JSON.GET key [path]: the document, or the part of it at path, or None when the key is missing. A JSONPath that matches nothing yields an empty array, which is not None.

    Client::json_get_text

    async fn Client::json_get_text(self : Client, key : String, path? : String, indent? : String, newline? : String, space? : String) -> String? raise RedisError

    JSON.GET key [INDENT i] [NEWLINE n] [SPACE s] [path]: the reply exactly as the server wrote it, formatting included.

    Client::json_merge

    async fn Client::json_merge(self : Client, key : String, path : String, value :
    Json
    ) -> Unit raise RedisError

    JSON.MERGE key path value: merge value into the object at path, by RFC 7396: a null member removes the member, an object merges recursively, anything else replaces.

    Client::json_mget

    async fn Client::json_mget(self : Client, keys : Array[String], path : String) -> Array[
    Json
    ?] raise RedisError

    JSON.MGET key [key ...] path: the value at path in each key, None where a key has nothing there.

    Client::json_mset

    async fn Client::json_mset(self : Client, triplets : Array[(String, String,
    Json
    )]) -> Unit raise RedisError

    JSON.MSET key path value [key path value ...]: set several documents at once, all or none.

    Client::json_numincrby

    async fn Client::json_numincrby(self : Client, key : String, path : String, value : Double) -> Array[Double?] raise RedisError

    JSON.NUMINCRBY key path value: add value to each number at path, returning the new values.

    Client::json_nummultby

    async fn Client::json_nummultby(self : Client, key : String, path : String, value : Double) -> Array[Double?] raise RedisError

    JSON.NUMMULTBY key path value: multiply each number at path by value, returning the new values.

    Client::json_objkeys

    async fn Client::json_objkeys(self : Client, key : String, path? : String) -> Array[Array[String]?] raise RedisError

    JSON.OBJKEYS key [path]: the member names of each object at path.

    Client::json_objlen

    async fn Client::json_objlen(self : Client, key : String, path? : String) -> Array[Int64?] raise RedisError

    JSON.OBJLEN key [path]: the number of members of each object at path.

    Client::json_resp

    async fn Client::json_resp(self : Client, key : String, path? : String) ->
    RespValue
    raise RedisError

    JSON.RESP key [path]: the value as RESP itself, with [ and { markers for arrays and objects. It is the one JSON command whose reply is not a JSON document.

    Client::json_set

    async fn Client::json_set(self : Client, key : String, path : String, value :
    Json
    , nx? : Bool, xx? : Bool, fpha? : Fpha) -> Bool raise RedisError

    JSON.SET key path value [NX|XX] [FPHA type]: store value at path in key. Returns false when nx or xx leaves the key unchanged.

    Client::json_strappend

    async fn Client::json_strappend(self : Client, key : String, path : String, value : String) -> Array[Int64?] raise RedisError

    JSON.STRAPPEND key [path] value: append value, a JSON string, to each string at path, returning the new lengths.

    Client::json_strlen

    async fn Client::json_strlen(self : Client, key : String, path? : String) -> Array[Int64?] raise RedisError

    JSON.STRLEN key [path]: the length of each string at path.

    Client::json_toggle

    async fn Client::json_toggle(self : Client, key : String, path : String) -> Array[Bool?] raise RedisError

    JSON.TOGGLE key path: flip each boolean at path, returning the new values.

    Client::json_type

    async fn Client::json_type(self : Client, key : String, path? : String) -> Array[String?] raise RedisError

    JSON.TYPE key [path]: the JSON type of each value at path — object, array, string, integer, number, boolean or null — None where nothing matched.

    Client::keys

    async fn Client::keys(self : Client, pattern : String) -> Array[String] raise RedisError

    KEYS pattern: every key matching pattern. Use scan in production.

    Client::lastsave

    async fn Client::lastsave(self : Client) -> Int64 raise RedisError

    LASTSAVE: the Unix timestamp of the last successful save to disk.

    Client::lindex

    async fn Client::lindex(self : Client, key : String, index : Int) -> Bytes? raise RedisError

    LINDEX key index: the element at index, or None if out of range.

    Client::linsert

    async fn Client::linsert(self : Client, key : String, where_ : String, pivot : String, value : String) -> Int64 raise RedisError

    LINSERT key where pivot value: insert value before (BEFORE) or after (AFTER) pivot. Returns the new length, or -1 when pivot is absent.

    Client::llen

    async fn Client::llen(self : Client, key : String) -> Int64 raise RedisError

    LLEN key: the length of the list.

    Client::lmove

    async fn Client::lmove(self : Client, source : String, destination : String, wherefrom : String, whereto : String) -> Bytes? raise RedisError

    LMOVE source destination LEFT|RIGHT LEFT|RIGHT: pop from one end of source and push to one end of destination, returning the element, or None when empty.

    Client::lpop

    async fn Client::lpop(self : Client, key : String) -> Bytes? raise RedisError

    LPOP key: remove and return the head element, or None when the list is empty.

    Client::lpopn

    async fn Client::lpopn(self : Client, key : String, count : Int) -> Array[Bytes] raise RedisError

    LPOP key count: remove and return up to count head elements.

    Client::lpush

    async fn Client::lpush(self : Client, key : String, values : Array[String]) -> Int64 raise RedisError

    LPUSH key value...: prepend each value, returning the new length.

    Client::lpushx

    async fn Client::lpushx(self : Client, key : String, values : Array[String]) -> Int64 raise RedisError

    LPUSHX key value...: prepend only if key already exists, returning the length.

    Client::lrange

    async fn Client::lrange(self : Client, key : String, start : Int, stop : Int) -> Array[Bytes] raise RedisError

    LRANGE key start stop: the elements from start to stop (inclusive, negative from the tail).

    Client::lrem

    async fn Client::lrem(self : Client, key : String, count : Int, value : String) -> Int64 raise RedisError

    LREM key count value: remove the first count elements equal to value. When count is negative, remove from the tail; when 0, remove all. Returns the removed.

    Client::lset

    async fn Client::lset(self : Client, key : String, index : Int, value : String) -> Unit raise RedisError

    LSET key index value: set the element at index. Raises Reply on a bad index.

    Client::ltrim

    async fn Client::ltrim(self : Client, key : String, start : Int, stop : Int) -> Unit raise RedisError

    LTRIM key start stop: keep only the elements from start to stop.

    Client::mget

    async fn Client::mget(self : Client, keys : Array[String]) -> Array[Bytes?] raise RedisError

    MGET key...: the value at each key, None where a key is absent, in the same order.

    Client::move_

    async fn Client::move_(self : Client, key : String, db : Int) -> Bool raise RedisError

    MOVE key db: move key to another logical database. true if moved.

    Client::mset

    async fn Client::mset(self : Client, pairs : Array[(String, String)]) -> Unit raise RedisError

    MSET key value...: store every pair atomically.

    Client::new

    fn Client::new(conn : &RedisConn) -> Client

    A client over conn.

    Client::object_encoding

    async fn Client::object_encoding(self : Client, key : String) -> String raise RedisError

    OBJECT ENCODING key / OBJECT REFCOUNT key / OBJECT IDLETIME key: inspect a key's internal encoding, reference count, or idle time.

    Client::object_idletime

    async fn Client::object_idletime(self : Client, key : String) -> Int64 raise RedisError

    Client::object_refcount

    async fn Client::object_refcount(self : Client, key : String) -> Int64 raise RedisError

    Client::persist

    async fn Client::persist(self : Client, key : String) -> Bool raise RedisError

    PERSIST key: remove key's expiry. true if a TTL was removed.

    Client::pexpire

    async fn Client::pexpire(self : Client, key : String, milliseconds : Int64) -> Bool raise RedisError

    PEXPIRE key ms: set a ms-millisecond expiry on key. false if the key is absent.

    Client::pexpireat

    async fn Client::pexpireat(self : Client, key : String, milliseconds_timestamp : Int64) -> Bool raise RedisError

    PEXPIREAT key ts: expire key at the given Unix millisecond. false if absent.

    Client::pfadd

    async fn Client::pfadd(self : Client, key : String, values : Array[String]) -> Int64 raise RedisError

    PFADD key value...: register the values, returning 1 if the sketch changed.

    Client::pfcount

    async fn Client::pfcount(self : Client, keys : Array[String]) -> Int64 raise RedisError

    PFCOUNT key...: the approximate cardinality of one key, or the union of several.

    Client::pfmerge

    async fn Client::pfmerge(self : Client, destination : String, sources : Array[String]) -> Unit raise RedisError

    PFMERGE dest src...: merge the source sketches into dest.

    Client::ping

    async fn Client::ping(self : Client) -> String raise RedisError

    PING: a round-trip health check, returning the server's PONG text.

    Client::ping_message

    async fn Client::ping_message(self : Client, message : String) -> String raise RedisError

    PING message: echo message back, confirming the connection.

    Client::psetex

    async fn Client::psetex(self : Client, key : String, milliseconds : Int64, value : String) -> Unit raise RedisError

    PSETEX key ms value: store value at key with a ms-millisecond expiry.

    Client::psubscribe

    async fn Client::psubscribe(self : Client, patterns : Array[String]) -> Unit raise RedisError

    PSUBSCRIBE pattern...: subscribe to channels by glob pattern.

    Client::pttl

    async fn Client::pttl(self : Client, key : String) -> Int64 raise RedisError

    PTTL key: key's remaining time to live in milliseconds.

    Client::publish

    async fn Client::publish(self : Client, channel : String, message : String) -> Int64 raise RedisError

    PUBLISH channel message: post message to channel, returning how many subscribers received it. (Publishing is an ordinary command, not a subscription.)

    Client::punsubscribe

    async fn Client::punsubscribe(self : Client, patterns? : Array[String]) -> Unit raise RedisError

    PUNSUBSCRIBE [pattern...]: unsubscribe from the given patterns, or all when omitted.

    Client::randomkey

    async fn Client::randomkey(self : Client) -> String? raise RedisError

    RANDOMKEY: a random key from the database, or None when the database is empty.

    Client::rename

    async fn Client::rename(self : Client, key : String, newkey : String) -> Unit raise RedisError

    RENAME key newkey: rename key to newkey, replacing newkey if present.

    Client::renamenx

    async fn Client::renamenx(self : Client, key : String, newkey : String) -> Bool raise RedisError

    RENAMENX key newkey: rename key to newkey only if newkey is absent. true if renamed.

    Client::replicaof

    async fn Client::replicaof(self : Client, host : String, port : Int) -> Unit raise RedisError

    REPLICAOF host port: make this server a replica of host:port. Use REPLICAOF NO ONE (via replicaof_noone) to promote it back to a master.

    Client::replicaof_noone

    async fn Client::replicaof_noone(self : Client) -> Unit raise RedisError

    REPLICAOF NO ONE: stop replicating and become a master.

    Client::restore

    async fn Client::restore(self : Client, key : String, ttl : Int64, serialized : Bytes, replace? : Bool, absttl? : Bool) -> Unit raise RedisError

    RESTORE key ttl serialized [REPLACE] [ABSTTL]: restore a DUMP value at key with a ttl-millisecond expiry (0 = no expiry).

    Client::rpop

    async fn Client::rpop(self : Client, key : String) -> Bytes? raise RedisError

    RPOP key: remove and return the tail element, or None when the list is empty.

    Client::rpoplpush

    async fn Client::rpoplpush(self : Client, source : String, destination : String) -> Bytes? raise RedisError

    RPOPLPUSH source destination: pop the tail of source and push it to the head of destination, returning the element, or None when source is empty.

    Client::rpopn

    async fn Client::rpopn(self : Client, key : String, count : Int) -> Array[Bytes] raise RedisError

    RPOP key count: remove and return up to count tail elements.

    Client::rpush

    async fn Client::rpush(self : Client, key : String, values : Array[String]) -> Int64 raise RedisError

    RPUSH key value...: append each value, returning the new length.

    Client::rpushx

    async fn Client::rpushx(self : Client, key : String, values : Array[String]) -> Int64 raise RedisError

    RPUSHX key value...: append only if key already exists, returning the length.

    Client::sadd

    async fn Client::sadd(self : Client, key : String, members : Array[String]) -> Int64 raise RedisError

    SADD key member...: add the members, returning how many were new.

    Client::save

    async fn Client::save(self : Client) -> Unit raise RedisError

    SAVE: synchronously save the dataset to disk (blocks the server).

    Client::scan

    async fn Client::scan(self : Client, cursor : String, pattern? : String, count? : Int, kind? : String) -> (String, Array[String]) raise RedisError

    SCAN cursor [MATCH pattern] [COUNT n] [TYPE kind]: an incremental key scan. Returns the next cursor (the empty string when the scan is done) and the keys found this call.

    Client::scard

    async fn Client::scard(self : Client, key : String) -> Int64 raise RedisError

    SCARD key: the number of members in the set.

    Client::script_exists

    async fn Client::script_exists(self : Client, shas : Array[String]) -> Array[Bool] raise RedisError

    SCRIPT EXISTS sha...: whether each digest is loaded, in order.

    Client::script_flush

    async fn Client::script_flush(self : Client) -> Unit raise RedisError

    SCRIPT FLUSH: discard every loaded script.

    Client::script_load

    async fn Client::script_load(self : Client, script : String) -> String raise RedisError

    SCRIPT LOAD script: register script and return its SHA-1 digest for later EVALSHA.

    Client::sdiff

    async fn Client::sdiff(self : Client, keys : Array[String]) -> Array[String] raise RedisError

    SDIFF key...: the members in the first set absent from the rest.

    Client::sdiffstore

    async fn Client::sdiffstore(self : Client, destination : String, keys : Array[String]) -> Int64 raise RedisError

    SDIFFSTORE destination key...: store the difference of the sets in destination.

    Client::select

    async fn Client::select(self : Client, index : Int) -> Unit raise RedisError

    SELECT index: switch the connection to logical database index.

    Client::sentinel

    async fn Client::sentinel(self : Client, args : Array[String]) ->
    RespValue
    raise RedisError

    SENTINEL ...: send a raw sentinel sub-command (the sub-command name is the first args element), returning the reply.

    Client::sentinel_get_master_addr_by_name

    async fn Client::sentinel_get_master_addr_by_name(self : Client, name : String) -> (String, Int)? raise RedisError

    SENTINEL GET-MASTER-ADDR-BY-NAME name: the current master's (host, port) for the monitored master name, or None if the sentinel does not know it.

    Client::set

    async fn Client::set(self : Client, key : String, value : String, ex? : Int64, px? : Int64, nx? : Bool, xx? : Bool, keepttl? : Bool) -> Bool raise RedisError

    SET key value [EX secs] [PX ms] [NX|XX] [KEEPTTL]: store value at key. Returns false when nx/xx leaves the key unchanged, true otherwise.

    Client::set_get

    async fn Client::set_get(self : Client, key : String, value : String) -> Bytes? raise RedisError

    SET key value GET: store value and return the value key held before, or None if it had none.

    Client::setbit

    async fn Client::setbit(self : Client, key : String, offset : Int64, value : Int) -> Int64 raise RedisError

    SETBIT key offset value: set the bit at offset (0 or 1), returning its previous value (0 or 1).

    Client::setex

    async fn Client::setex(self : Client, key : String, seconds : Int64, value : String) -> Unit raise RedisError

    SETEX key secs value: store value at key with a secs-second expiry.

    Client::setnx

    async fn Client::setnx(self : Client, key : String, value : String) -> Bool raise RedisError

    SETNX key value: store value only if key is absent. true if stored.

    Client::setrange

    async fn Client::setrange(self : Client, key : String, offset : Int, value : String) -> Int64 raise RedisError

    SETRANGE key offset value: overwrite key at offset, returning the new length.

    Client::shutdown

    async fn Client::shutdown(self : Client, save? : Bool) -> Unit raise RedisError

    SHUTDOWN [NOSAVE|SAVE]: stop the server. The call normally raises Closed when the connection drops, rather than returning.

    Client::sinter

    async fn Client::sinter(self : Client, keys : Array[String]) -> Array[String] raise RedisError

    SINTER key...: the members present in every given set.

    Client::sinterstore

    async fn Client::sinterstore(self : Client, destination : String, keys : Array[String]) -> Int64 raise RedisError

    SINTERSTORE destination key...: store the intersection of the sets in destination.

    Client::sismember

    async fn Client::sismember(self : Client, key : String, m : String) -> Bool raise RedisError

    SISMEMBER key member: whether member is in the set.

    Client::slowlog_get

    async fn Client::slowlog_get(self : Client, count? : Int) -> Array[
    RespValue
    ] raise RedisError

    SLOWLOG GET [count]: the most recent slow commands the server logged.

    Client::slowlog_len

    async fn Client::slowlog_len(self : Client) -> Int64 raise RedisError

    SLOWLOG LEN: the number of entries in the slow log.

    Client::slowlog_reset

    async fn Client::slowlog_reset(self : Client) -> Unit raise RedisError

    SLOWLOG RESET: clear the slow log.

    Client::smembers

    async fn Client::smembers(self : Client, key : String) -> Array[String] raise RedisError

    SMEMBERS key: every member of the set.

    Client::smove

    async fn Client::smove(self : Client, source : String, destination : String, m : String) -> Bool raise RedisError

    SMOVE source destination member: move member from source to destination. true if moved.

    Client::spop

    async fn Client::spop(self : Client, key : String) -> String? raise RedisError

    SPOP key: remove and return a random member, or None when the set is empty.

    Client::spopn

    async fn Client::spopn(self : Client, key : String, count : Int) -> Array[String] raise RedisError

    SPOP key count: remove and return up to count random members.

    Client::spublish

    async fn Client::spublish(self : Client, channel : String, message : String) -> Int64 raise RedisError

    SPUBLISH shardchannel message: post message to a shard channel, returning how many subscribers received it.

    Client::srandmember

    async fn Client::srandmember(self : Client, key : String) -> String? raise RedisError

    SRANDMEMBER key: a random member, or None when the set is empty.

    Client::srandmembern

    async fn Client::srandmembern(self : Client, key : String, count : Int) -> Array[String] raise RedisError

    SRANDMEMBER key count: count random members, with repeats when count exceeds the set size.

    Client::srem

    async fn Client::srem(self : Client, key : String, members : Array[String]) -> Int64 raise RedisError

    SREM key member...: remove the members, returning how many existed.

    Client::sscan

    async fn Client::sscan(self : Client, key : String, cursor : String, pattern? : String, count? : Int) -> (String, Array[String]) raise RedisError

    SSCAN key cursor [MATCH pattern] [COUNT n]: an incremental set member scan. Returns the next cursor and the members found this call.

    Client::ssubscribe

    async fn Client::ssubscribe(self : Client, channels : Array[String]) -> Unit raise RedisError

    SSUBSCRIBE shardchannel...: subscribe to shard channels (cluster pub/sub), which route to a single shard rather than every node.

    Client::strlen

    async fn Client::strlen(self : Client, key : String) -> Int64 raise RedisError

    STRLEN key: the length of key's value in bytes.

    Client::subscribe

    async fn Client::subscribe(self : Client, channels : Array[String]) -> Unit raise RedisError

    SUBSCRIBE channel...: subscribe the connection to the given channels. After this the connection receives message frames until unsubscribed.

    Client::sunion

    async fn Client::sunion(self : Client, keys : Array[String]) -> Array[String] raise RedisError

    SUNION key...: the members present in any given set.

    Client::sunionstore

    async fn Client::sunionstore(self : Client, destination : String, keys : Array[String]) -> Int64 raise RedisError

    SUNIONSTORE destination key...: store the union of the sets in destination.

    Client::sunsubscribe

    async fn Client::sunsubscribe(self : Client, channels? : Array[String]) -> Unit raise RedisError

    SUNSUBSCRIBE [shardchannel...]: unsubscribe from the given shard channels, or all when omitted.

    Client::swapdb

    async fn Client::swapdb(self : Client, a : Int, b : Int) -> Unit raise RedisError

    SWAPDB a b: atomically swap the data of databases a and b.

    Client::tdigest_add

    async fn Client::tdigest_add(self : Client, key : String, values : Array[Double]) -> Unit raise RedisError

    TDIGEST.ADD key value [value ...]: add observations.

    Client::tdigest_byrank

    async fn Client::tdigest_byrank(self : Client, key : String, ranks : Array[Int64]) -> Array[Double] raise RedisError

    TDIGEST.BYRANK key rank [rank ...]: the value at each rank.

    Client::tdigest_byrevrank

    async fn Client::tdigest_byrevrank(self : Client, key : String, ranks : Array[Int64]) -> Array[Double] raise RedisError

    TDIGEST.BYREVRANK key rank [rank ...]: the value at each reverse rank.

    Client::tdigest_cdf

    async fn Client::tdigest_cdf(self : Client, key : String, values : Array[Double]) -> Array[Double] raise RedisError

    TDIGEST.CDF key value [value ...]: the fraction of observations at or below each value.

    Client::tdigest_create

    async fn Client::tdigest_create(self : Client, key : String, compression? : Int64) -> Unit raise RedisError

    TDIGEST.CREATE key [COMPRESSION compression]: create a t-digest. A higher compression keeps more centroids and estimates the tails more precisely.

    Client::tdigest_info

    async fn Client::tdigest_info(self : Client, key : String) -> Info raise RedisError

    TDIGEST.INFO key: compression, capacity, and how many observations were merged.

    Client::tdigest_max

    async fn Client::tdigest_max(self : Client, key : String) -> Double raise RedisError

    TDIGEST.MAX key: the largest observation, or NaN when the sketch is empty.

    Client::tdigest_merge

    async fn Client::tdigest_merge(self : Client, destination : String, sources : Array[String], compression? : Int64, overwrite? : Bool) -> Unit raise RedisError

    TDIGEST.MERGE destination numKeys source... [COMPRESSION c] [OVERRIDE]: merge sketches into one; overwrite replaces the destination's contents instead of adding.

    Client::tdigest_min

    async fn Client::tdigest_min(self : Client, key : String) -> Double raise RedisError

    TDIGEST.MIN key: the smallest observation, or NaN when the sketch is empty.

    Client::tdigest_quantile

    async fn Client::tdigest_quantile(self : Client, key : String, quantiles : Array[Double]) -> Array[Double] raise RedisError

    TDIGEST.QUANTILE key quantile [quantile ...]: the value at each quantile, 0 to 1.

    Client::tdigest_rank

    async fn Client::tdigest_rank(self : Client, key : String, values : Array[Double]) -> Array[Int64] raise RedisError

    TDIGEST.RANK key value [value ...]: how many observations are below each value.

    Client::tdigest_reset

    async fn Client::tdigest_reset(self : Client, key : String) -> Unit raise RedisError

    TDIGEST.RESET key: empty a t-digest without dropping the key.

    Client::tdigest_revrank

    async fn Client::tdigest_revrank(self : Client, key : String, values : Array[Double]) -> Array[Int64] raise RedisError

    TDIGEST.REVRANK key value [value ...]: how many observations are above each value.

    Client::tdigest_trimmed_mean

    async fn Client::tdigest_trimmed_mean(self : Client, key : String, low_cut : Double, high_cut : Double) -> Double raise RedisError

    TDIGEST.TRIMMED_MEAN key low_cut high_cut: the mean after dropping the observations below low_cut and above high_cut, both quantiles from 0 to 1.

    Client::time_

    async fn Client::time_(self : Client) -> (Int64, Int64) raise RedisError

    TIME: the server's current time as (seconds, microseconds).

    Client::topk_add

    async fn Client::topk_add(self : Client, key : String, items : Array[String]) -> Array[String?] raise RedisError

    TOPK.ADD key item [item ...]: count each item, returning the item it evicted from the list at that position, or None when the list did not change.

    Client::topk_count

    async fn Client::topk_count(self : Client, key : String, items : Array[String]) -> Array[Int64] raise RedisError

    TOPK.COUNT key item [item ...]: the estimated count of each item.

    Client::topk_incrby

    async fn Client::topk_incrby(self : Client, key : String, items : Array[(String, Int64)]) -> Array[String?] raise RedisError

    TOPK.INCRBY key item increment [item increment ...]: add to the counts, returning the evicted item per entry.

    Client::topk_info

    async fn Client::topk_info(self : Client, key : String) -> Info raise RedisError

    TOPK.INFO key: the sketch's size and decay.

    Client::topk_list

    async fn Client::topk_list(self : Client, key : String) -> Array[String] raise RedisError

    TOPK.LIST key: the items in the top-k list, heaviest first.

    Client::topk_list_with_count

    async fn Client::topk_list_with_count(self : Client, key : String) -> Array[(String, Int64)] raise RedisError

    TOPK.LIST key WITHCOUNT: the items in the top-k list with their counts.

    Client::topk_query

    async fn Client::topk_query(self : Client, key : String, items : Array[String]) -> Array[Bool] raise RedisError

    TOPK.QUERY key item [item ...]: whether each item is in the top-k list.

    Client::topk_reserve

    async fn Client::topk_reserve(self : Client, key : String, topk : Int64, width? : Int64, depth? : Int64, decay? : Double) -> Unit raise RedisError

    TOPK.RESERVE key topk [width depth decay]: create a sketch that keeps the topk heaviest items.

    Client::touch

    async fn Client::touch(self : Client, keys : Array[String]) -> Int64 raise RedisError

    TOUCH key...: the number of the given keys that exist (like EXISTS but does not alter the LRU/LFU, and accepts multiple keys).

    Client::ts_add

    async fn Client::ts_add(self : Client, key : String, timestamp : Int64, value : Double, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, on_duplicate? : String, labels? : Array[(String, String)]) -> Int64 raise RedisError

    TS.ADD key timestamp value [RETENTION ms] [ENCODING ...] [CHUNK_SIZE bytes][ON_DUPLICATE policy] [LABELS ...]: append one sample, returning its timestamp.

    Client::ts_alter

    async fn Client::ts_alter(self : Client, key : String, retention? : Int64, chunk_size? : Int64, duplicate_policy? : String, ignore_max_time_diff? : Int64, ignore_max_val_diff? : Double, labels? : Array[(String, String)]) -> Unit raise RedisError

    TS.ALTER key [RETENTION ms] [CHUNK_SIZE bytes] [DUPLICATE_POLICY policy][IGNORE ...] [LABELS ...]: change a series' settings; LABELS replaces the label set.

    Client::ts_create

    async fn Client::ts_create(self : Client, key : String, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, duplicate_policy? : String, ignore_max_time_diff? : Int64, ignore_max_val_diff? : Double, labels? : Array[(String, String)]) -> Unit raise RedisError

    TS.CREATE key [RETENTION ms] [ENCODING COMPRESSED|UNCOMPRESSED] [CHUNK_SIZE bytes][DUPLICATE_POLICY policy] [IGNORE max_time_diff max_val_diff] [LABELS ...]: create a series, optionally dropping samples older than retention.

    Client::ts_createrule

    async fn Client::ts_createrule(self : Client, source : String, destination : String, aggregator : String, bucket : Int64, align_timestamp? : Int64) -> Unit raise RedisError

    TS.CREATERULE source destination AGGREGATION aggregator bucketDuration[alignTimestamp]: compact source into destination in buckets of bucket ms.

    Client::ts_decrby

    async fn Client::ts_decrby(self : Client, key : String, value : Double, timestamp? : Int64, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, duplicate_policy? : String, labels? : Array[(String, String)]) -> Int64 raise RedisError

    TS.DECRBY key value [TIMESTAMP ts] ...: subtract value from the sample at timestamp, returning the timestamp.

    Client::ts_del

    async fn Client::ts_del(self : Client, key : String, from_ : String, to : String) -> Int64 raise RedisError

    TS.DEL key fromTimestamp toTimestamp: delete the samples in the range, returning how many were removed.

    Client::ts_deleterule

    async fn Client::ts_deleterule(self : Client, source : String, destination : String) -> Unit raise RedisError

    TS.DELETERULE source destination: stop compacting source into destination.

    Client::ts_get

    async fn Client::ts_get(self : Client, key : String, latest? : Bool) -> Sample? raise RedisError

    TS.GET key [LATEST]: the newest sample, or None when the series is empty.

    Client::ts_incrby

    async fn Client::ts_incrby(self : Client, key : String, value : Double, timestamp? : Int64, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, duplicate_policy? : String, labels? : Array[(String, String)]) -> Int64 raise RedisError

    TS.INCRBY key value [TIMESTAMP ts] [RETENTION ms] [ENCODING ...] [CHUNK_SIZE bytes][DUPLICATE_POLICY policy] [LABELS ...]: add value to the sample at timestamp, creating the sample when there is none, and return the timestamp.

    Client::ts_info

    async fn Client::ts_info(self : Client, key : String) -> TsInfo raise RedisError

    TS.INFO key: the series' size, settings, labels and compaction rules.

    Client::ts_madd

    async fn Client::ts_madd(self : Client, samples : Array[(String, Int64, Double)]) -> Array[Int64?] raise RedisError

    TS.MADD key timestamp value [key timestamp value ...]: append several samples at once, returning each timestamp, None where that sample was refused.

    Client::ts_mget

    async fn Client::ts_mget(self : Client, filters : Array[String], options? : MultiGetOptions) -> Array[Series] raise RedisError

    TS.MGET [options] FILTER filter...: the latest sample of every series whose labels match.

    Client::ts_mrange

    async fn Client::ts_mrange(self : Client, from_ : TimeBound, to : TimeBound, filters : Array[String], options? : MultiRangeOptions) -> Array[Series] raise RedisError

    TS.MRANGE fromTimestamp toTimestamp [options] FILTER filter...: the samples of every series whose labels match, oldest first.

    Client::ts_mrevrange

    async fn Client::ts_mrevrange(self : Client, from_ : TimeBound, to : TimeBound, filters : Array[String], options? : MultiRangeOptions) -> Array[Series] raise RedisError

    TS.MREVRANGE fromTimestamp toTimestamp [options] FILTER filter...: the same, newest first. The bounds keep the order TS.MRANGE uses.

    Client::ts_nrange

    async fn Client::ts_nrange(self : Client, keys : Array[String], from_ : TimeBound, to : TimeBound, options? : RangeOptions) -> Array[PivotRow] raise RedisError

    TS.NRANGE numkeys key... fromTimestamp toTimestamp [options]: the samples of several series pivoted by timestamp, one value column per key in the order the keys are given.

    Client::ts_nrevrange

    async fn Client::ts_nrevrange(self : Client, keys : Array[String], from_ : TimeBound, to : TimeBound, options? : RangeOptions) -> Array[PivotRow] raise RedisError

    TS.NREVRANGE numkeys key... fromTimestamp toTimestamp [options]: the same, newest first. The bounds keep the order TS.NRANGE uses.

    Client::ts_queryindex

    async fn Client::ts_queryindex(self : Client, filters : Array[String]) -> Array[String] raise RedisError

    TS.QUERYINDEX filter...: the keys whose labels match every filter.

    Client::ts_querylabel_values

    async fn Client::ts_querylabel_values(self : Client, label : String, filters? : Array[String]) -> Array[String] raise RedisError

    TS.QUERYLABELS VALUES label [FILTER filter...]: every value of one label in use.

    Client::ts_querylabels

    async fn Client::ts_querylabels(self : Client, filters? : Array[String]) -> Array[String] raise RedisError

    TS.QUERYLABELS [FILTER filter...]: every label name in use.

    Client::ts_range

    async fn Client::ts_range(self : Client, key : String, from_ : TimeBound, to : TimeBound, options? : RangeOptions) -> Array[Sample] raise RedisError

    TS.RANGE key fromTimestamp toTimestamp [options]: the samples in the range, oldest first.

    Client::ts_read

    async fn Client::ts_read(self : Client, key : String, timestamp : Int64, block? : (Int64, Int64), max_count? : Int64) -> Array[Sample] raise RedisError

    TS.READ key timestamp [BLOCK ms count] [MAX_COUNT n]: up to max_count samples from timestamp on, waiting for at least block's count when it is given.

    Client::ts_revrange

    async fn Client::ts_revrange(self : Client, key : String, from_ : TimeBound, to : TimeBound, options? : RangeOptions) -> Array[Sample] raise RedisError

    TS.REVRANGE key fromTimestamp toTimestamp [options]: the samples in the range, newest first. The bounds keep the order TS.RANGE uses; only the reply is reversed.

    Client::ttl

    async fn Client::ttl(self : Client, key : String) -> Int64 raise RedisError

    TTL key: key's remaining time to live in seconds: -2 if absent, -1 if no expiry, otherwise the seconds left.

    Client::type_

    async fn Client::type_(self : Client, key : String) -> String raise RedisError

    TYPE key: the type stored at key (string, list, set, ...), or none.
    async fn Client::unlink(self : Client, keys : Array[String]) -> Int64 raise RedisError

    UNLINK key...: delete the given keys asynchronously, returning how many existed.

    Client::unsubscribe

    async fn Client::unsubscribe(self : Client, channels? : Array[String]) -> Unit raise RedisError

    UNSUBSCRIBE [channel...]: unsubscribe from the given channels, or all when omitted.

    Client::unwatch

    async fn Client::unwatch(self : Client) -> Unit raise RedisError

    UNWATCH: clear all watched keys.

    Client::watch

    async fn Client::watch(self : Client, keys : Array[String]) -> Unit raise RedisError

    WATCH key...: mark keys so a later transaction aborts if they change before EXEC.

    Client::xack

    async fn Client::xack(self : Client, key : String, group : String, ids : Array[String]) -> Int64 raise RedisError

    XACK key group id...: acknowledge the given entries for a consumer group, returning how many were newly acknowledged.

    Client::xadd

    async fn Client::xadd(self : Client, key : String, id : String, fields : Array[(String, String)], maxlen? : Int64, approx? : Bool) -> String raise RedisError

    XADD key [MAXLEN [~] n] id field value...: append an entry, returning its id. Use id of * for an auto-generated id.

    Client::xdel

    async fn Client::xdel(self : Client, key : String, ids : Array[String]) -> Int64 raise RedisError

    XDEL key id...: delete the given entries, returning how many were removed.

    Client::xgroup_create

    async fn Client::xgroup_create(self : Client, key : String, group : String, id : String, mkstream? : Bool) -> Unit raise RedisError

    XGROUP CREATE key group id [MKSTREAM]: create a consumer group. id is the last delivered id ($ for new entries only, 0 for all); mkstream creates the stream if absent.

    Client::xgroup_createconsumer

    async fn Client::xgroup_createconsumer(self : Client, key : String, group : String, consumer : String) -> Bool raise RedisError

    XGROUP CREATECONSUMER key group consumer: create a consumer in a group. true if newly created.

    Client::xgroup_delconsumer

    async fn Client::xgroup_delconsumer(self : Client, key : String, group : String, consumer : String) -> Int64 raise RedisError

    XGROUP DELCONSUMER key group consumer: delete a consumer, returning its pending entries that are now orphaned.

    Client::xgroup_destroy

    async fn Client::xgroup_destroy(self : Client, key : String, group : String) -> Bool raise RedisError

    XGROUP DESTROY key group: delete a consumer group. true if it existed.

    Client::xlen

    async fn Client::xlen(self : Client, key : String) -> Int64 raise RedisError

    XLEN key: the number of entries in the stream.

    Client::xpending

    async fn Client::xpending(self : Client, key : String, group : String) -> PendingSummary raise RedisError

    XPENDING key group: the pending-entry summary for a group. For the detailed entry list use xpending_extended.

    Client::xrange

    async fn Client::xrange(self : Client, key : String, start : String, end : String, count? : Int) -> Array[StreamEntry] raise RedisError

    XRANGE key start end [COUNT n]: the entries from start to end (use -/+ for the ends), oldest first.

    Client::xread

    async fn Client::xread(self : Client, streams : Array[(String, String)], count? : Int, block? : Int64) -> Array[(String, Array[StreamEntry])]? raise RedisError

    XREAD [COUNT n] [BLOCK ms] STREAMS key id...: read new entries from one or more streams. block of 0 reads without blocking; a positive block waits up to that many milliseconds for the first entry. Returns, per stream, its name and the entries read, or None when a blocking read times out.

    Client::xreadgroup

    async fn Client::xreadgroup(self : Client, group : String, consumer : String, streams : Array[(String, String)], count? : Int, block? : Int64, noack? : Bool) -> Array[(String, Array[StreamEntry])]? raise RedisError

    XREADGROUP GROUP group consumer [COUNT n] [BLOCK ms] [NOACK] STREAMS key id...: read entries for a consumer, marking them pending. id of > reads new entries; a specific id reads pending ones. Returns per stream its name and entries, or None on a blocking timeout.

    Client::xrevrange

    async fn Client::xrevrange(self : Client, key : String, end : String, start : String, count? : Int) -> Array[StreamEntry] raise RedisError

    XREVRANGE key end start [COUNT n]: the entries from end to start, newest first.

    Client::xtrim

    async fn Client::xtrim(self : Client, key : String, maxlen : Int64, approx? : Bool) -> Int64 raise RedisError

    XTRIM key MAXLEN [~] n: cap the stream at n entries, returning how many were trimmed.

    Client::zadd

    async fn Client::zadd(self : Client, key : String, members : Array[(String, Double)], nx? : Bool, xx? : Bool, ch? : Bool) -> Int64 raise RedisError

    ZADD key [NX] [XX] [CH] score member...: add or update members with their scores, returning how many members changed (or, with ch, were added or updated).

    Client::zcard

    async fn Client::zcard(self : Client, key : String) -> Int64 raise RedisError

    ZCARD key: the number of members in the sorted set.

    Client::zcount

    async fn Client::zcount(self : Client, key : String, min : String, max : String) -> Int64 raise RedisError

    ZCOUNT key min max: the number of members with scores in [min, max].

    Client::zincrby

    async fn Client::zincrby(self : Client, key : String, increment : Double, m : String) -> Double raise RedisError

    ZINCRBY key increment member: add increment to member's score, returning the new score.

    Client::zinterstore

    async fn Client::zinterstore(self : Client, destination : String, keys : Array[String], weights? : Array[Double], aggregate? : String) -> Int64 raise RedisError

    ZINTERSTORE destination numkeys key... [WEIGHTS w...] [AGGREGATE SUM|MIN|MAX]: store the intersection of the sorted sets, returning how many members the result has.

    Client::zmscore

    async fn Client::zmscore(self : Client, key : String, members : Array[String]) -> Array[Double?] raise RedisError

    ZMSCORE key member...: the score of each member, None where absent, in order.

    Client::zpopmax

    async fn Client::zpopmax(self : Client, key : String, count? : Int) -> Array[(String, Double)] raise RedisError

    ZPOPMAX key [count]: remove and return the highest-scoring count members.

    Client::zpopmin

    async fn Client::zpopmin(self : Client, key : String, count? : Int) -> Array[(String, Double)] raise RedisError

    ZPOPMIN key [count]: remove and return the lowest-scoring count members and their scores.

    Client::zrandmember

    async fn Client::zrandmember(self : Client, key : String, count? : Int) -> Array[String] raise RedisError

    ZRANDMEMBER key [count] [WITHSCORES]: one or more random members, optionally with scores.

    Client::zrandmember_scores

    async fn Client::zrandmember_scores(self : Client, key : String, count : Int) -> Array[(String, Double)] raise RedisError

    ZRANDMEMBER key count WITHSCORES: random members with their scores. A negative count may repeat a member.

    Client::zrange

    async fn Client::zrange(self : Client, key : String, start : Int, stop : Int) -> Array[String] raise RedisError

    ZRANGE key start stop: the members from start to stop (inclusive, negative from the tail), lowest score first.

    Client::zrange_scores

    async fn Client::zrange_scores(self : Client, key : String, start : Int, stop : Int) -> Array[(String, Double)] raise RedisError

    ZRANGE key start stop WITHSCORES: the members and scores in rank order.

    Client::zrangebyscore

    async fn Client::zrangebyscore(self : Client, key : String, min : String, max : String, offset? : Int, count? : Int) -> Array[String] raise RedisError

    ZRANGEBYSCORE key min max [LIMIT offset count]: members with scores in [min, max] (use (score to exclude a bound), lowest score first.

    Client::zrangebyscore_scores

    async fn Client::zrangebyscore_scores(self : Client, key : String, min : String, max : String, offset? : Int, count? : Int) -> Array[(String, Double)] raise RedisError

    ZRANGEBYSCORE ... WITHSCORES: the members and scores in score order.

    Client::zrank

    async fn Client::zrank(self : Client, key : String, m : String) -> Int64? raise RedisError

    ZRANK key member: the rank (0-based, lowest score first) of member, or None if absent.

    Client::zrem

    async fn Client::zrem(self : Client, key : String, members : Array[String]) -> Int64 raise RedisError

    ZREM key member...: remove the members, returning how many existed.

    Client::zremrangebyrank

    async fn Client::zremrangebyrank(self : Client, key : String, start : Int, stop : Int) -> Int64 raise RedisError

    ZREMRANGEBYRANK key start stop: remove members by rank range, returning the removed.

    Client::zremrangebyscore

    async fn Client::zremrangebyscore(self : Client, key : String, min : String, max : String) -> Int64 raise RedisError

    ZREMRANGEBYSCORE key min max: remove members by score range, returning the removed.

    Client::zrevrange

    async fn Client::zrevrange(self : Client, key : String, start : Int, stop : Int) -> Array[String] raise RedisError

    ZREVRANGE key start stop: the members in rank order, highest score first.

    Client::zrevrange_scores

    async fn Client::zrevrange_scores(self : Client, key : String, start : Int, stop : Int) -> Array[(String, Double)] raise RedisError

    ZREVRANGE key start stop WITHSCORES: the members and scores, highest score first.

    Client::zrevrangebyscore

    async fn Client::zrevrangebyscore(self : Client, key : String, max : String, min : String, offset? : Int, count? : Int) -> Array[String] raise RedisError

    ZREVRANGEBYSCORE key max min [LIMIT offset count]: members with scores in [min, max], highest score first.

    Client::zrevrangebyscore_scores

    async fn Client::zrevrangebyscore_scores(self : Client, key : String, max : String, min : String, offset? : Int, count? : Int) -> Array[(String, Double)] raise RedisError

    ZREVRANGEBYSCORE ... WITHSCORES: the members and scores, highest score first.

    Client::zrevrank

    async fn Client::zrevrank(self : Client, key : String, m : String) -> Int64? raise RedisError

    ZREVRANK key member: the rank (0-based, highest score first) of member.

    Client::zscan

    async fn Client::zscan(self : Client, key : String, cursor : String, pattern? : String, count? : Int) -> (String, Array[String]) raise RedisError

    ZSCAN key cursor [MATCH pattern] [COUNT n]: an incremental sorted-set member scan. Returns the next cursor and the members found this call.

    Client::zscore

    async fn Client::zscore(self : Client, key : String, m : String) -> Double? raise RedisError

    ZSCORE key member: the score of member, or None if absent.

    Client::zunionstore

    async fn Client::zunionstore(self : Client, destination : String, keys : Array[String], weights? : Array[Double], aggregate? : String) -> Int64 raise RedisError

    ZUNIONSTORE destination numkeys key... [WEIGHTS w...] [AGGREGATE SUM|MIN|MAX]: store the union of the sorted sets, returning how many members the result has.

    ClientOptions

    pub(all) struct ClientOptions {
    host : String
    port : Int
    username : String?
    password : String?
    db : Int
    protocol : Protocol
    tls :
    Client
    ?
    connect_timeout : Int64
    read_timeout : Int64
    write_timeout : Int64
    pool : PoolOptions
    retry : RetryOptions
    tracking : TrackingOptions
    }

    Everything needed to reach and speak to a redis: the endpoint and credentials, the protocol, the timeouts, and the pool, retry and tracking policies.

    ClientOptions::at

    fn ClientOptions::at(host : String, port : Int) -> ClientOptions

    ClientOptions at host:port, over the standard defaults (RESP3, database 0, no TLS).

    ClientOptions::with_auth

    fn ClientOptions::with_auth(self : ClientOptions, username : String?, password : String?) -> ClientOptions

    A copy of self that authenticates with username and password.

    ClientOptions::with_db

    fn ClientOptions::with_db(self : ClientOptions, db : Int) -> ClientOptions

    A copy of self that SELECTs db on connect.

    ClusterClient

    pub struct ClusterClient {
    nodes : Map[String, &RedisConn]
    topology : ClusterTopology
    limit : Int
    dial : async (String) -> &RedisConn raise RedisError?
    }

    A cluster-aware client: it routes a command to the node owning its key and follows MOVED and ASK redirects. Built from a connection per node address and the topology.

    A redirect can name a node it was not built with, after a reshard or a failover. dial opens a connection to such a node; without it that redirect is a Connection error.

    ClusterClient::command

    Send args to the node owning its key, following redirects up to the limit. The key is the first argument after the command name. MOVED updates the topology, since the slot has gone for good; ASK does not, since only this key has gone ahead so far, and the node it names serves the key only straight after ASKING.

    ClusterClient::new

    fn ClusterClient::new(nodes : Array[(String, &RedisConn)], topology : ClusterTopology, limit? : Int, dial? : async (String) -> &RedisConn raise RedisError) -> ClusterClient

    A cluster client over nodes (address, connection pairs) and topology.

    ClusterClient::set_topology

    fn ClusterClient::set_topology(self : ClusterClient, topology : ClusterTopology) -> Unit

    Replace the routing topology (after a redirect, or on a refresh).

    ClusterSlot

    pub struct ClusterSlot {
    start : Int
    end : Int
    node : String
    }

    A contiguous range of slots owned by one node, named by host:port.

    ClusterSlot::new

    fn ClusterSlot::new(start : Int, end : Int, node : String) -> ClusterSlot

    A slot range [start, end] owned by node (host:port).

    ClusterTopology

    pub struct ClusterTopology {
    slots : Array[ClusterSlot]
    }

    The slot-to-node map the client routes with.

    ClusterTopology::assign

    fn ClusterTopology::assign(self : ClusterTopology, slot : Int, node : String) -> Unit

    Record that slot lives on node. Singles sit ahead of the ranges, so the first match in node_for_slot is the latest word on a slot.

    ClusterTopology::new

    ClusterTopology from an explicit slot list (used after parsing CLUSTER SLOTS, or in tests).

    ClusterTopology::node_for_slot

    fn ClusterTopology::node_for_slot(self : ClusterTopology, slot : Int) -> String?

    The node address (host:port) that owns slot, or None if no range covers it.

    CompactionRule

    pub(all) struct CompactionRule {
    destination : String
    bucket : Int64
    aggregator : String
    }

    A compaction rule: the series this one rolls into, how wide each bucket is, and how the bucket is reduced.

    FakeConn

    pub struct FakeConn {
    queue : Array[
    RespValue
    ]
    at : Int
    run : (Array[Bytes]) ->
    RespValue

    sent : Array[Array[Bytes]]
    }

    A redis connection backed by a scripted reply queue and, once the queue is spent, a handler keyed on the command sent. The tests drive the whole command surface through it without a socket, and the cluster and sentinel routing tests feed it handlers that mimic a node.

    FakeConn::execute

    async fn FakeConn::execute(self : FakeConn, args : Array[Bytes]) ->
    RespValue
    raise RedisError

    FakeConn::execute_all

    async fn FakeConn::execute_all(self : FakeConn, commands : Array[Array[Bytes]]) -> Array[
    RespValue
    ] raise RedisError

    FakeConn::handler

    A fake that answers every call with handler, ignoring any queue.

    FakeConn::new

    A fake that returns replies in order, then Null for every further call.

    FakeConn::sent

    fn FakeConn::sent(self : FakeConn) -> Array[Array[Bytes]]

    Every command the fake was asked to send, in order, so a test can assert the wire form a typed method builds and not only the reply it decodes.

    FieldValue

    pub(all) enum FieldValue {
    Text(String)
    Integer(Int64)
    Number(Double)
    Null
    } derive(Eq,
    Debug
    )

    One value in a search or aggregate reply: the fields of a document as text, and the computed values of an aggregation as the type the server sent.

    FieldValue::double

    fn FieldValue::double(self : FieldValue) -> Double?

    A value as a double, when it holds one.

    FieldValue::equal

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

    FieldValue::int

    fn FieldValue::int(self : FieldValue) -> Int64?

    A value as an integer, when it holds one.

    FieldValue::not_equal

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

    FieldValue::text

    fn FieldValue::text(self : FieldValue) -> String?

    A value as text, for the callers that only ever see text.

    Fpha

    pub(all) enum Fpha {
    Bf16
    Fp16
    Fp32
    Fp64
    } derive(Eq,
    Debug
    )

    The float array storage JSON.SET may be told to use: FPHA BF16, FP16, FP32 or FP64.

    Fpha::equal

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

    Fpha::not_equal

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

    Fpha::text

    fn Fpha::text(self : Fpha) -> String

    The keyword FPHA takes for this storage.

    Fpha::to_repr

    Fusion

    pub(all) enum Fusion {
    Rrf
    Linear
    } derive(Eq,
    Debug
    )

    How a hybrid query fuses the two branches.

    Fusion::equal

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

    Fusion::not_equal

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

    Fusion::to_repr

    GeoFilter

    pub(all) struct GeoFilter {
    field : String
    longitude : Double
    latitude : Double
    radius : Double
    unit : String
    }

    A distance a document's geo field must fall within.

    HybridOptions

    pub(all) struct HybridOptions {
    knn : Int64
    ef_runtime : Int64?
    radius : (Double, Double)?
    fusion : Fusion?
    fusion_params : (Double, Double)?
    load : Array[String]
    sort_by : SortKey?
    offset : Int64
    limit : Int64
    filter : String?
    params : Array[(String, Bytes)]
    timeout : Int64?
    }

    The options FT.HYBRID takes besides the index, the text query and the vector.

    IndexField

    pub(all) struct IndexField {
    identifier : String
    attribute : String
    type_ : String
    sortable : Bool
    unf : Bool
    noindex : Bool
    weight : Double
    }

    One indexed field as FT.INFO describes it.

    IndexInfo

    pub(all) struct IndexInfo {
    name : String
    key_type : String
    prefixes : Array[String]
    filter : String?
    default_score : Double
    num_docs : Int64
    max_doc_id : Int64
    num_terms : Int64
    num_records : Int64
    indexing : Bool
    percent_indexed : Double
    indexing_failures : Int64
    attributes : Array[IndexField]
    }

    What FT.INFO reports about an index: its size, its schema and its settings.

    IndexKind

    pub(all) enum IndexKind {
    Hash
    Json
    } derive(Eq,
    Debug
    )

    What an index is built over.

    IndexKind::equal

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

    IndexKind::not_equal

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

    Info

    pub(all) struct Info {
    items : Map[String, InfoValue]
    }

    The name/value pairs an INFO reply holds, looked up by name. Redis answers these with a flat array under RESP2 and a map under RESP3; both come back as this.

    Info::double

    fn Info::double(self : Info, name : String) -> Double?

    The value under name as a double, accepting a number or its decimal text.

    Info::flag

    fn Info::flag(self : Info, name : String) -> Bool?

    The value under name as a flag.

    Info::get

    fn Info::get(self : Info, name : String) -> InfoValue

    The value stored under name, or Missing.

    Info::int

    fn Info::int(self : Info, name : String) -> Int64?

    The value under name as an integer, or None when it is not a whole number.

    Info::text

    fn Info::text(self : Info, name : String) -> String?

    The value under name as text.

    InfoValue

    pub(all) enum InfoValue {
    Text(String)
    Number(Double)
    Flag(Bool)
    Missing
    } derive(Eq,
    Debug
    )

    One value in a module's INFO reply: the four shapes those replies use. A key the server did not report reads as Missing rather than raising, because the set of keys grows between versions.

    InfoValue::equal

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

    InfoValue::not_equal

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

    Message

    pub struct Message {
    kind : String
    channel : String
    payload : Bytes
    pattern : String?
    count : Int64
    }

    One frame of the pub/sub stream. kind is the redis frame name (message, subscribe, ...); payload is the message body for a message/smessage frame, and count is the remaining subscription count for a subscribe/unsubscribe frame.

    Message::parse

    Parse a pub/sub frame — a RESP2 array or RESP3 push — into a Message, or None if the value is not a pub/sub frame.

    MultiGetOptions

    pub(all) struct MultiGetOptions {
    with_labels : Bool
    select_labels : Array[String]
    latest : Bool
    }

    The options a multi-series point query takes.

    MultiRangeOptions

    pub(all) struct MultiRangeOptions {
    range : RangeOptions
    with_labels : Bool
    select_labels : Array[String]
    group_by : String?
    reduce : String?
    exclude_empty : Bool
    }

    The options a multi-series query adds: which labels to carry, and how to group.

    NumericFilter

    pub(all) struct NumericFilter {
    field : String
    min : String
    max : String
    }

    A numeric range a document's field must fall in.

    PendingSummary

    pub struct PendingSummary {
    count : Int64
    min_id : String?
    max_id : String?
    consumers : Array[(String, Int64)]
    }

    The summary XPENDING returns for a group: how many pending, the first and last pending ids, and per-consumer pending counts.

    Pipeline

    pub struct Pipeline {
    conn : &RedisConn
    queue : Array[Array[Bytes]]
    transaction : Bool
    }

    A queued batch of commands against one connection. Add commands with add; run them with execute. Set multi first to send them inside MULTI/EXEC.

    Pipeline::add

    fn Pipeline::add(self : Pipeline, args : Array[Bytes]) -> Unit

    Queue args as the next command.

    Pipeline::execute

    Run the queued commands in one round trip. Without multi the replies come back in order, an error reply being one among them. With multi they run atomically and the EXEC result comes back: Aborted when a watched key changed, Reply when redis refused the batch, as it does for a command it could not queue.

    Pipeline::multi

    fn Pipeline::multi(self : Pipeline) -> Unit

    Switch the pipeline to transaction mode: execute will wrap the queued commands in MULTI/EXEC.

    Pipeline::new

    fn Pipeline::new(conn : &RedisConn) -> Pipeline

    A pipeline over conn.

    PivotRow

    pub(all) struct PivotRow {
    timestamp : Int64
    values : Array[Double?]
    }

    One row of a reply pivoted by timestamp: the timestamp and one value per key, None where that key has no sample there.

    PoolOptions

    pub(all) struct PoolOptions {
    max_idle : Int
    max_active : Int
    min_idle : Int
    idle_timeout : Int64
    health_check : Bool
    }

    The pool a client draws connections from: its size bounds, how long an idle connection lives, and whether a borrowed connection is checked before use.

    Protocol

    pub(all) enum Protocol {
    Resp2
    Resp3
    }

    Which RESP version to negotiate with HELLO. RESP2 is the long-standing wire; RESP3 adds the typed null, boolean, double, map, set and push values and is required for client-side caching.

    RangeOptions

    pub(all) struct RangeOptions {
    latest : Bool
    filter_by_ts : Array[Int64]
    filter_by_value : (Double, Double)?
    count : Int64
    aggregation : String?
    bucket : Int64
    align : String?
    bucket_timestamp : String?
    empty : Bool
    }

    The options a range query takes: paging, filtering, and how to bucket the samples.

    Redirect

    pub(all) enum Redirect {
    Moved(slot~ : Int, node~ : String)
    Ask(slot~ : Int, node~ : String)
    } derive(Eq,
    Debug
    )

    Where a cluster node sent a command.

    Redirect::equal

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

    Redirect::not_equal

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

    Redirect::to_repr

    Reducer

    pub(all) struct Reducer {
    function : String
    args : Array[String]
    as_ : String?
    }

    One REDUCE of an aggregation: a function, its arguments, and the name its result takes.

    RetryConn

    pub struct RetryConn {
    inner : &RedisConn
    retry : RetryOptions
    dial : async () -> &RedisConn raise RedisError?
    wait : async (Int64) -> Unit noraise?
    }

    A connection that retries transport failures up to retry.attempts times, leaving a redis error reply to surface at once. A dropped connection stays dropped, so a retry that is to reach the server needs dial to open another; wait sleeps for the backoff. @socket.connect_retrying wires both.

    RetryConn::execute

    async fn RetryConn::execute(self : RetryConn, args : Array[Bytes]) ->
    RespValue
    raise RedisError

    RetryConn::execute_all

    async fn RetryConn::execute_all(self : RetryConn, commands : Array[Array[Bytes]]) -> Array[
    RespValue
    ] raise RedisError

    RetryConn::new

    fn RetryConn::new(inner : &RedisConn, retry : RetryOptions, dial? : async () -> &RedisConn raise RedisError, wait? : async (Int64) -> Unit noraise) -> RetryConn

    A retrying view of inner under retry.

    RetryOptions

    pub(all) struct RetryOptions {
    attempts : Int
    base_delay : Int64
    max_delay : Int64
    level : Int
    jitter : Bool
    }

    How a call retries after a transport failure: how many attempts in total, the backoff between them and how hard it backs off.

    Sample

    pub(all) struct Sample {
    timestamp : Int64
    value : Double
    } derive(Eq,
    Debug
    )

    One sample: when it was recorded, and what it measured.

    Sample::equal

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

    Sample::not_equal

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

    Sample::to_repr

    Schema

    pub(all) struct Schema {
    on : IndexKind
    prefixes : Array[String]
    filter : String?
    language : String?
    language_field : String?
    score : Double?
    score_field : String?
    temporary : Int64?
    stopwords : Array[String]?
    fields : Array[SchemaField]
    }

    What FT.CREATE builds: the documents it reads and the fields it indexes.

    Schema::new

    fn Schema::new(fields : Array[SchemaField]) -> Schema

    A schema over fields with the default index options.

    SchemaField

    pub(all) struct SchemaField {
    name : String
    kind : SchemaKind
    as_ : String?
    sortable : Bool
    unf : Bool
    noindex : Bool
    weight : Double?
    separator : String?
    case_sensitive : Bool
    phonetic : String?
    no_stem : Bool
    with_suffix_trie : Bool
    index_empty : Bool
    index_missing : Bool
    vector : VectorSpec?
    }

    One field of a schema: the document field it reads, the name queries use, and the options its type takes.

    SchemaField::geo

    fn SchemaField::geo(name : String, as_? : String, sortable? : Bool, unf? : Bool, noindex? : Bool, index_empty? : Bool, index_missing? : Bool) -> SchemaField

    A GEO field.

    SchemaField::numeric

    fn SchemaField::numeric(name : String, as_? : String, sortable? : Bool, unf? : Bool, noindex? : Bool, index_empty? : Bool, index_missing? : Bool) -> SchemaField

    A NUMERIC field.

    SchemaField::tag

    fn SchemaField::tag(name : String, as_? : String, separator? : String, case_sensitive? : Bool, sortable? : Bool, unf? : Bool, noindex? : Bool, with_suffix_trie? : Bool, index_empty? : Bool, index_missing? : Bool) -> SchemaField

    A TAG field.

    SchemaField::text

    fn SchemaField::text(name : String, as_? : String, sortable? : Bool, unf? : Bool, noindex? : Bool, weight? : Double, phonetic? : String, no_stem? : Bool, with_suffix_trie? : Bool, index_empty? : Bool, index_missing? : Bool) -> SchemaField

    A TEXT field.

    SchemaField::vector

    fn SchemaField::vector(name : String, spec : VectorSpec, as_? : String, sortable? : Bool, noindex? : Bool) -> SchemaField

    A VECTOR field.

    SchemaKind

    pub(all) enum SchemaKind {
    Text
    Tag
    Numeric
    Geo
    Vector
    } derive(Eq,
    Debug
    )

    The type of one schema field.

    SchemaKind::equal

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

    SchemaKind::not_equal

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

    Script

    pub struct Script {
    source : String
    // private fields
    }

    A Lua script run by its digest, as go-redis's Script runs one: loaded on first use, and loaded again if the server has forgotten it.

    Script::new

    fn Script::new(source : String) -> Script

    A script of source. Nothing is sent until run.

    Script::run

    async fn Script::run(self : Script, client : Client, keys : Array[String], args : Array[String]) ->
    RespValue
    raise RedisError

    Run the script over keys and args.

    SearchHit

    pub(all) struct SearchHit {
    id : String
    fields : Array[(String,
    RespValue
    )]
    score : Double?
    payload : Bytes?
    sort_key : String?
    }

    One document a query returned: its key, the fields asked for, and the score, payload or sort key when the query asked for them.

    SearchHit::field

    fn SearchHit::field(self : SearchHit, name : String) -> String?

    The field name of a hit as text, or None when the query did not return it.

    SearchOptions

    pub(all) struct SearchOptions {
    nocontent : Bool
    verbatim : Bool
    with_scores : Bool
    with_payloads : Bool
    with_sort_keys : Bool
    return_fields : Array[String]
    highlight : Array[String]
    summarize : Summarize?
    sort_by : SortKey?
    offset : Int64
    limit : Int64
    dialect : Int?
    params : Array[(String, Bytes)]
    timeout : Int64?
    in_keys : Array[String]
    in_fields : Array[String]
    filter : NumericFilter?
    geo_filter : GeoFilter?
    scorer : String?
    slop : Int64?
    language : String?
    explain_score : Bool
    }

    The options FT.SEARCH takes besides the index and the query.

    SearchResult

    pub(all) struct SearchResult {
    total : Int64
    hits : Array[SearchHit]
    warnings : Array[String]
    }

    What FT.SEARCH and FT.HYBRID answer: how many documents matched, the ones this page returned, and any warning the query raised.

    SentinelClient

    pub struct SentinelClient {
    sentinels : Array[&RedisConn]
    }

    A client that resolves a master address through a list of sentinel connections, trying each in turn until one answers.

    SentinelClient::new

    fn SentinelClient::new(sentinels : Array[&RedisConn]) -> SentinelClient

    A sentinel client over sentinels (connection to each sentinel node).

    SentinelClient::resolve

    async fn SentinelClient::resolve(self : SentinelClient, name : String) -> String raise RedisError

    Resolve the master address for name, querying sentinels in order; the first answer wins. Returns the host:port string to dial.

    Series

    pub(all) struct Series {
    key : String
    labels : Array[(String, String)]
    samples : Array[Sample]
    }

    One series of a multi-series reply: its key, its labels, and the samples the query selected.

    SortKey

    pub(all) struct SortKey {
    field : String
    ascending : Bool
    }

    A field to sort by and the direction.

    SpellCheckTerm

    pub(all) struct SpellCheckTerm {
    term : String
    suggestions : Array[(Double, String)]
    }

    One term the index does not know, and what it suggests instead.

    StreamEntry

    pub struct StreamEntry {
    id : String
    fields : Array[(String, String)]
    }

    One stream entry: its id and its field/value pairs.

    Summarize

    pub(all) struct Summarize {
    fields : Array[String]
    fragments : Int64?
    length : Int64?
    separator : String?
    }

    Which fragments of each field SUMMARIZE returns, and with what separator.

    TimeBound

    pub(all) enum TimeBound {
    Min
    Max
    At(Int64)
    } derive(Eq,
    Debug
    )

    A point in a range query: the earliest sample the series has, the latest, or a timestamp.

    TimeBound::equal

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

    TimeBound::not_equal

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

    TimeBound::text

    fn TimeBound::text(self : TimeBound) -> String

    The -, + or decimal text a range query writes for this bound.

    TrackingOptions

    pub(all) struct TrackingOptions {
    enabled : Bool
    bcast : Bool
    optin : Bool
    optout : Bool
    noloop : Bool
    redirect : Int64?
    }

    Client-side caching (CLIENT TRACKING): whether keys this client reads are tracked so redis pushes invalidations, and in which mode.

    TsInfo

    pub(all) struct TsInfo {
    total_samples : Int64
    memory_usage : Int64
    first_timestamp : Int64
    last_timestamp : Int64
    retention_millis : Int64
    chunk_count : Int64
    chunk_size : Int64
    chunk_type : String
    duplicate_policy : String
    labels : Array[(String, String)]
    source_key : String?
    rules : Array[CompactionRule]
    ignore_max_time_diff : Int64
    ignore_max_val_diff : Double
    }

    What TS.INFO reports about a series.

    VectorAlgorithm

    pub(all) enum VectorAlgorithm {
    Flat
    Hnsw
    } derive(Eq,
    Debug
    )

    How a vector field is indexed: Flat scans every vector, Hnsw builds a navigable small-world graph over them.

    VectorAlgorithm::equal

    VectorAlgorithm::not_equal

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

    VectorSpec

    pub(all) struct VectorSpec {
    algorithm : VectorAlgorithm
    dim : Int
    element : String
    distance : String
    initial_cap : Int64?
    block_size : Int64?
    m : Int64?
    ef_construction : Int64?
    ef_runtime : Int64?
    epsilon : Double?
    }

    The parameters a VECTOR field takes.

    VectorSpec::flat

    fn VectorSpec::flat(dim : Int, element? : String, distance? : String, initial_cap? : Int64, block_size? : Int64) -> VectorSpec

    A flat (brute force) vector index over dim dimensions.

    VectorSpec::hnsw

    fn VectorSpec::hnsw(dim : Int, element? : String, distance? : String, initial_cap? : Int64, m? : Int64, ef_construction? : Int64, ef_runtime? : Int64, epsilon? : Double) -> VectorSpec

    An HNSW vector index over dim dimensions.

    aggregate_default

    let aggregate_default : AggregateOptions

    FT.AGGREGATE's options at their documented defaults.

    aggregate_field

    fn aggregate_field(row : Array[(String, FieldValue)], name : String) -> FieldValue?

    The value of name in an aggregate row.

    arg_bytes

    fn arg_bytes(b : Bytes) -> Bytes

    A binary-safe argument, passed through unchanged.

    arg_double

    fn arg_double(d : Double) -> Bytes

    A Double argument as its decimal text.

    arg_int

    fn arg_int(n : Int) -> Bytes

    An Int argument as its decimal text.

    arg_int64

    fn arg_int64(n : Int64) -> Bytes

    An Int64 argument as its decimal text.

    arg_string

    fn arg_string(s : String) -> Bytes

    A string argument, UTF-8 encoded.

    backoff_delay

    fn backoff_delay(attempt : Int, retry : RetryOptions) -> Int64

    The delay before retry number attempt (0-based), growing as base * level^attempt and capped at max_delay. The transport adds jitter when the policy asks for it.

    client_default

    let client_default : ClientOptions

    crc16

    fn crc16(data : Bytes) -> Int

    The CRC16-CCITT (XMODEM) of data: polynomial 0x1021, initial 0, no reflection — the checksum redis uses to place a key in a slot.

    decode_cluster_slots

    Parse a CLUSTER SLOTS reply into a ClusterTopology. Each entry is [start, end,[host, port, id], ...replicas...]; the master's host:port is the owning node.

    decode_info

    A module INFO reply as an Info. The RESP3 map is read directly; the RESP2 flat array is read pairwise, which is how every module writes it.

    expect_array

    A reply as an Array[RespValue]: an array, or the nil an empty result decodes to.

    expect_bool

    fn expect_bool(reply :
    RespValue
    ) -> Bool raise RedisError

    A reply as a Bool: the 1/0 redis uses for existence, success and comparison, or the boolean RESP3 sends for the same answer.

    expect_bytes

    fn expect_bytes(reply :
    RespValue
    ) -> Bytes? raise RedisError

    A reply as binary bytes, or None for the nil a missing key decodes to.

    expect_double

    fn expect_double(reply :
    RespValue
    ) -> Double raise RedisError

    A reply as a Double: a double, the integer a score may come back as, or a parsed decimal string.

    expect_int64

    fn expect_int64(reply :
    RespValue
    ) -> Int64 raise RedisError

    A reply as an Int64: an integer value, or the +1/-1 a command aliases to.

    expect_number

    fn expect_number(reply :
    RespValue
    ) -> Int64 raise RedisError

    A number redis writes as text: TIME, and the ports and counts of sentinel and stream replies, come back as strings under both protocols.

    expect_score

    fn expect_score(reply :
    RespValue
    ) -> Double? raise RedisError

    A score that may be missing: RESP3 sends a double, RESP2 a string, and both nil.

    expect_some

    The members of a reply that is one bulk value without a count and an array with one, and nothing when the key is missing.

    expect_string

    fn expect_string(reply :
    RespValue
    ) -> String? raise RedisError

    A reply as a String, or None for nil.

    expect_string_value

    fn expect_string_value(reply :
    RespValue
    ) -> String raise RedisError

    A reply as a String, raising on nil (for commands that always return a value).

    expect_text

    fn expect_text(reply :
    RespValue
    ) -> String raise RedisError

    A reply as text: a bulk string, a simple string, or a verbatim string. A module returns numbers as text on RESP2, so a call that wants the written form goes through here.

    expect_text_list

    fn expect_text_list(reply :
    RespValue
    ) -> Array[String] raise RedisError

    A list of text, from an array or the set RESP3 answers TS.QUERYINDEX with.

    field_value

    A reply value as a FieldValue.

    hash_slot

    fn hash_slot(key : String) -> Int

    The slot a key hashes to. A key of the form prefix{tag}suffix hashes by tag (the hash tag), so those keys colocate; otherwise the whole key is hashed. The result is taken modulo 16384.

    hybrid_default

    let hybrid_default : HybridOptions

    FT.HYBRID's options at their documented defaults.

    info_scalar

    One value of an INFO reply: a scalar, a flag, or a null the server left empty.

    is_cluster_down

    fn is_cluster_down(msg : String) -> Bool

    Whether a redis error reply is a CLUSTERDOWN, the cluster unable to serve.

    is_noscript

    fn is_noscript(msg : String) -> Bool

    Whether a redis error reply is the NOSCRIPT a forgotten script digest draws, so a Script reloads and retries.

    multi_get_default

    let multi_get_default : MultiGetOptions

    Multi-series get options at their documented defaults.

    multi_range_default

    let multi_range_default : MultiRangeOptions

    Multi-series range options at their documented defaults.

    numeric_value

    fn numeric_value(reply :
    RespValue
    ) -> Double

    A numeric reply: a double, an integer, or the decimal text RESP2 writes. A module that has no value to report writes nan, which arrives as NaN here.

    path_items

    A reply that is one value or an array of one, as the items of an array. JSONPath commands answer with an array, the older single-path form with a bare value, and RESP3 adds a wrapper of its own; callers want neither detail.

    pool_default

    let pool_default : PoolOptions

    protocol_version

    fn protocol_version(protocol : Protocol) -> Int

    The HELLO version argument each protocol negotiates.

    push_some

    fn push_some(builder : Array[Bytes], token : Bytes, value : Bytes?) -> Unit

    Append an optional argument only when it is present, in a when Some arm.

    range_default

    let range_default : RangeOptions

    Range options at their documented defaults.

    redirect

    fn redirect(msg : String) -> Redirect?

    What a MOVED or ASK error reply points at; None when the message is neither.

    redirect_limit

    let redirect_limit : Int

    How many redirects one command may follow before giving up; go-redis's MaxRedirects.

    reply_error

    The client's reply when a command returns a redis error value, or Protocol when the reply is not an error value at all but also not the shape the command expected.

    retry_default

    let retry_default : RetryOptions

    same_slot

    fn same_slot(keys : Array[String]) -> Bool

    Whether every key hashes to the same slot — required for multi-key commands in a cluster.

    search_default

    let search_default : SearchOptions

    FT.SEARCH's options at their documented defaults.

    should_retry

    fn should_retry(error : RedisError, attempt : Int, retry : RetryOptions) -> Bool

    Whether an error on attempt (0-based, the attempt that just failed) is worth retrying under retry: only a transport failure, and only while attempts remain.

    status_ok

    Assert a status reply (the +OK most write commands return). Any other shape is a protocol error.

    tracking_default

    let tracking_default : TrackingOptions