componentized/directory

componentized:valkey

interface dev

A WASM component client for Valkey (and Redis).

interface commands componentized:valkey/commands@0.3.0-dev

Typed functions for Valkey's commands, over the mechanics of a connection.

Each function sends one command and converts its reply. The docs of a function cover what differs from the raw command, see the linked Valkey docs for what the command does. Commands that change the state of the connection itself are on the connection, e.g. SUBSCRIBE, MULTI and EXEC, WATCH, RESET and HELLO.

The types are those of the types interface, used here under names that may change, e.g. renamed to avoid clashing with a function for a new command. Refer to a type through types for a name that does not change.

The functions follow these idioms:

  • Arguments are in the order of the command's words.
  • A list argument must have at least one item, as the command requires, an empty list fails with a client error before anything is sent. A list the command allows to be left out is an option, none rather than empty.
  • An optional argument is an option, a flag is a bool, e.g. replace for REPLACE, and a choice of keywords is an enum or a variant, e.g. list-side for LEFT | RIGHT.
  • Durations and points in time are records named for their unit, e.g. duration-seconds and unix-time-milliseconds.
  • Keys, fields, patterns and names are string. Values, members and payloads are string-or-bytes, a reply that is not UTF-8 is bytes. Values that are binary by nature, like the serialized values of DUMP and RESTORE, are bytes. A reply where a string is expected that is not UTF-8 fails with a client error.
  • A null reply is none, e.g. GET of a key that does not exist.
  • An integer reply that is 0 or 1 is a bool, e.g. whether HSETNX set the field.
  • An integer reply with sentinel values is a variant or an enum with a case for each, e.g. ttl-reply for TTL's -2 and -1, or none when it stands for nothing, e.g. BITPOS's -1.
  • A reply whose shape an option changes, e.g. with WITHSCORES, has a function of its own for that form, e.g. zrange-withscores, its docs naming the other forms.
  • A scan starts with the start cursor and resumes with the one it returned, none once it is complete.
  • An error reply fails with a server error. Arguments the client rejects, and replies it cannot convert, fail with a client error.
  • A command that blocks, e.g. BLPOP, or changes the state of the connection, e.g. SELECT, affects every caller sharing the connection, see the command's docs.

Types

use resource connectionsince 0.3.0-dev

from componentized:valkey/connection@0.3.0-dev

  • static async functionnew: static async func( replies: stream<resp-value>, closed: future<result<_, error-code>>, opts: option<connect-opts>, ) -> tuple<stream<resp-value>, future<result<connection, error-code>>>since 0.3.0-dev

    Establishes a connection over a transport.

    replies are the values the transport receives from the server, and closed resolves when the transport closes, to ok for a graceful close or to the error otherwise, see tcp.transport.receive. Returns the requests for the transport to write to the server, in order, and the connection once it is established.

    The connection sends HELLO 3, with the auth and client-name of opts, as its first command. This pins the connection to RESP3 and confirms the server can be reached. The future resolves to the connection once HELLO succeeds, or to the error that stopped it. The rest of opts is applied before the connection is returned.

    It then reports the library to the server, CLIENT SETINFO LIB-NAME componentized:valkey and LIB-VER with the version of the package, ignoring an error from a server that does not know CLIENT SETINFO. They survive reset, client-setinfo replaces them.

    Async so the connection keeps working between commands after it returns, e.g. to read push messages and to send keep-alive pings.

  • functionserver-properties: func() -> list<tuple<string, resp-value>>since 0.3.0-dev

    The server's properties from the reply to HELLO, e.g. server, version and mode.

  • async functionexchange: async func( command: list<string-or-bytes>, ) -> result<resp-value, error-code>since 0.3.0-dev

    Sends a command and waits for its reply.

    Several commands may be in flight at once, replies are paired with commands in the order the commands were sent.

    For SUBSCRIBE, PSUBSCRIBE, SSUBSCRIBE and their UNSUBSCRIBE counterparts, prefer a subscription, which owns its targets' messages. Once the connection has one, it alone sends these commands, and they fail with a client error before anything is sent, here, with exchange-all, emit and transaction.

    RESET, HELLO and CLIENT REPLY always fail with a client error. See reset and server-properties, CLIENT REPLY would stop replies from pairing with commands, see emit.

    A command has at least one word, an empty command fails with a client error.

  • async functionexchange-all: async func( commands: list<list<string-or-bytes>>, ) -> list<result<resp-value, error-code>>since 0.3.0-dev

    Sends the commands one after another, with no other command sent between them, and waits for every reply.

    Each command has its own result, in order, as if each was sent with exchange. Commands sharing a connection may otherwise be interleaved with other callers' commands, which matters for a sequence that must not be interrupted, e.g. MULTI, its commands and EXEC.

  • async functionemit: async func( command: list<string-or-bytes>, ) -> result<_, error-code>since 0.3.0-dev

    Sends a command without waiting for its reply, resolving once the command is written.

    The server still replies, the reply is discarded when it arrives and an error it reports is not returned. An implementation may instead ask the server not to reply, e.g. with CLIENT REPLY SKIP.

    A command has at least one word, an empty command fails with a client error.

  • async functionwatch: async func(keys: list<string>) -> result<_, error-code>since 0.3.0-dev

    Marks the keys to watch, EXEC aborts the next transaction when any of them changed.

    Watched keys belong to the connection, and EXEC, DISCARD or UNWATCH from any caller sharing it clears them. Use a connection of your own for WATCH, the reads it guards, and the transaction.

    WATCH key [ key ... ] https://valkey.io/commands/watch/

    At least one key, no keys fails with a client error.

  • async functionunwatch: async func() -> result<_, error-code>since 0.3.0-dev

    Forgets all the watched keys.

    UNWATCH https://valkey.io/commands/unwatch/

  • async functiontransaction: async func( commands: list<list<string-or-bytes>>, ) -> result<option<list<resp-value>>, error-code>since 0.3.0-dev

    Runs the commands as a transaction, MULTI, each command, then EXEC, with no other command sent between them, see exchange-all.

    Returns none when a watched key changed and the transaction was aborted, otherwise the reply of each command in order. A command that fails while running is an error value in its place, the others still ran. A command rejected while queuing, e.g. an unknown command, fails the transaction with that error, none of the commands ran.

    MULTI and EXEC are only sent as part of a transaction, the commands between them reply QUEUED rather than their reply.

    MULTI, EXEC https://valkey.io/commands/multi/ https://valkey.io/commands/exec/

  • functionsubscription: func() -> result<subscription, error-code>since 0.3.0-dev

    A new subscription, subscribed to nothing yet, see the subscription's subscribe.

    From the first subscription, the connection owns its subscriptions: SUBSCRIBE, PSUBSCRIBE, SSUBSCRIBE and their UNSUBSCRIBE counterparts sent with exchange and the like fail with a client error, so the server's subscriptions stay in step with the connection's. Subscriptions made with exchange before are unsupported. They may keep delivering to dead-letters, the exact behavior is undocumented.

    Fails with a client error when the connection component was built without pub/sub, e.g. connection-minimal. Its push messages are then all dead letters, and SUBSCRIBE and the like may still be sent with exchange.

  • functiondead-letters: func() -> stream<resp-value>since 0.3.0-dev

    The values nothing else claims, kept apart from replies.

    Push messages that no subscription owns, e.g. client tracking invalidations, messages and confirmations of SUBSCRIBE sent with exchange, or kinds of push messages from a newer server. Values the server sends unprompted, when no command is waiting for a reply, are included, e.g. the feed of MONITOR, which are not RESP push values.

    Each call returns a new stream that receives every value arriving after the call, values arriving while no stream is open are dropped. A stream that falls too far behind is closed rather than holding up replies, the values it missed are lost.

  • async functionreset: async func() -> result<_, error-code>since 0.3.0-dev

    Resets the connection to the state of a new one, then repeats the handshake of new.

    RESET discards a transaction in progress, forgets the watched keys, unsubscribes from every channel, turns off client tracking and the like, selects database 0, and forgets the client name and the authenticated user. It also switches the connection to RESP2, so it is followed at once by HELLO 3 with the auth and client-name the connection was established with, with no other command sent between them. server-properties then holds the new reply to HELLO.

    The subscriptions are unsubscribed from every target, each with the reason reset, and stay open for new targets.

    No other command is sent until the handshake succeeds, so none runs on the connection RESET leaves. When the handshake fails, e.g. the credentials expired since the connection was established, the connection closes with its error, and the commands queued after the reset fail with it without being sent. Establish a new connection.

    RESET https://valkey.io/commands/reset/

  • functionset-keep-alive: func(interval: option<duration-milliseconds>)since 0.3.0-dev

    Sends PING when no command has been sent and no reply is outstanding for interval, none disables it. A PING that fails closes the connection. Disabled by default.

    Unlike TCP keep-alive, a PING counts as activity for the server's idle client timeout, and works over any transport.

use type doublesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

  • f64

use variant error-codesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

connection The errors of a connection and of every command interface.

  • closed: option<string>

    The transport closed while a reply was outstanding, or before the command was sent. Holds the transport's error when it did not close gracefully.

  • client: string

    Client errors are semantic issues with input/output values, e.g. a reply that does not have the shape the command expects.

  • resp: resp-error

    RESP errors are encoding issues converting values to/from bytes.

  • server: string-or-bytes

    Server errors are Error or BulkError RESP values returned directly from the server. An Error is a string, a BulkError a string when it is UTF-8, bytes otherwise.

  • lagged

    The reader of a stream fell too far behind and its stream was closed, rather than holding up the connection. What the stream missed is lost.

use type integersince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

  • s64

use variant resp-valuesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

use record duration-secondssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

shared by the commands A duration in whole seconds, e.g. EX seconds.

  • ex: u64

use record duration-millisecondssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A duration in whole milliseconds, e.g. PX milliseconds.

  • px: u64

use record unix-time-secondssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A point in time as whole seconds since the Unix epoch, e.g. EXAT unix-time-seconds.

  • exat: s64

use record unix-time-millisecondssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A point in time as whole milliseconds since the Unix epoch, e.g. PXAT unix-time-milliseconds.

  • pxat: s64

use variant cursorsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Where an incremental iteration continues from, e.g. with HSCAN.

A scan returns the cursor to resume from, always resume, none once the scan is complete. Pass it to the next call until then.

  • start

    Starts a new scan, the cursor 0.

  • resume: string

    Continues a scan from the opaque cursor the previous call returned, 0 fails with a client error, use start.

use enum ttl-modesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The condition for setting an expiration, e.g. with EXPIRE or HEXPIRE.

  • nx

    Set expiration only when the field has no expiration.

  • xx

    Set expiration only when the field has an existing expiration.

  • gt

    Set expiration only when the new expiration is greater than current one.

  • lt

    Set expiration only when the new expiration is less than current one.

use enum hexpire-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The outcome of setting the expiration of a hash field, e.g. with HEXPIRE.

  • does-not-exist

    -2: key does not exist, or field does not exist in the HASH.

  • condition-not-met

    0: the specified NX | XX | GT | LT condition has not been met.

  • applied

    1: the expiration time was applied.

  • zero-seconds

    2: when called with 0 seconds.

use enum hpexpireat-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The outcome of setting the expiration of a hash field, e.g. with HEXPIRE.

  • does-not-exist

    -2: key does not exist, or field does not exist in the HASH.

  • condition-not-met

    0: the specified NX | XX | GT | LT condition has not been met.

  • applied

    1: the expiration time was applied.

  • zero-seconds

    2: when called with 0 seconds.

use enum hpexpire-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The outcome of setting the expiration of a hash field, e.g. with HEXPIRE.

  • does-not-exist

    -2: key does not exist, or field does not exist in the HASH.

  • condition-not-met

    0: the specified NX | XX | GT | LT condition has not been met.

  • applied

    1: the expiration time was applied.

  • zero-seconds

    2: when called with 0 seconds.

use enum hexpireat-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The outcome of setting the expiration of a hash field, e.g. with HEXPIRE.

  • does-not-exist

    -2: key does not exist, or field does not exist in the HASH.

  • condition-not-met

    0: the specified NX | XX | GT | LT condition has not been met.

  • applied

    1: the expiration time was applied.

  • zero-seconds

    2: when called with 0 seconds.

use variant ttl-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The remaining time to live of a key or hash field, to the second, see ttl and httl.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-in: duration-seconds

    The time until it expires.

use variant httl-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The remaining time to live of a key or hash field, to the second, see ttl and httl.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-in: duration-seconds

    The time until it expires.

use variant pttl-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The remaining time to live of a key or hash field, to the millisecond, see pttl and hpttl.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-in: duration-milliseconds

    The time until it expires.

use variant hpttl-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The remaining time to live of a key or hash field, to the millisecond, see pttl and hpttl.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-in: duration-milliseconds

    The time until it expires.

use variant expiretime-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

When a key or hash field expires, to the second, see expiretime and hexpiretime.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-at: unix-time-seconds

    The time at which it expires.

use variant hexpiretime-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

When a key or hash field expires, to the second, see expiretime and hexpiretime.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-at: unix-time-seconds

    The time at which it expires.

use variant pexpiretime-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

When a key or hash field expires, to the millisecond, see pexpiretime and hpexpiretime.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-at: unix-time-milliseconds

    The time at which it expires.

use variant hpexpiretime-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

When a key or hash field expires, to the millisecond, see pexpiretime and hpexpiretime.

  • does-not-exist

    -2: the key does not exist, or for a hash field, the field or the hash does not exist.

  • no-expiration

    -1: the key or field exists, but has no expiration.

  • expires-at: unix-time-milliseconds

    The time at which it expires.

use variant acl-dryrun-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

admin commands Whether a user may run a command, see acl-dryrun.

  • allowed

    The user may run the command.

  • denied: string

    The user may not run the command, and why.

use record acl-log-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A security event, a command or authentication the rules denied, see acl-log.

  • count: integer

    The number of events like this one, within 60 seconds of each other.

  • reason: string

    What was denied, e.g. command, key, channel or auth.

  • context: string

    Where it was denied, e.g. toplevel, multi or lua.

  • object: string

    The command, key or channel that was denied.

  • username: string
  • age-seconds: double

    The seconds since the latest of these events.

  • client-info: string

    The connection, in the format of CLIENT LIST.

  • entry-id: option<integer>

    The ID of the entry, since Valkey 7.2.

  • timestamp-created: option<unix-time-milliseconds>

    When the first of these events happened, since Valkey 7.2.

  • timestamp-last-updated: option<unix-time-milliseconds>

    When the latest of these events happened, since Valkey 7.2.

use enum bgsave-operationsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

What BGSAVE does.

  • schedule

    SCHEDULE: saves once the rewrite of the append-only file in progress is done.

  • cancel

    CANCEL: cancels the save in progress, or scheduled.

use enum client-typesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The type of a connection, for the client-filter.

  • normal

    normal

  • primary

    master: the connection to the primary of a replica.

  • replica

    replica

  • pubsub

    pubsub

use variant client-filtersince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A filter of connections, for CLIENT KILL and CLIENT LIST.

  • id: list<integer>

    ID client-id [ client-id ... ]

  • type: client-type

    TYPE

  • user: string

    USER username

  • addr: string

    ADDR ip:port: the address of the client.

  • laddr: string

    LADDR ip:port: the address of the server the client connected to.

  • skipme: bool

    SKIPME YES | NO: whether to skip this connection, yes by default for CLIENT KILL.

  • maxage: duration-seconds

    MAXAGE: connections older than the time.

  • name: string

    NAME

  • idle: duration-seconds

    IDLE: connections idle for at least the time.

  • flags: string

    FLAGS: connections with all the flags, e.g. N.

  • lib-name: string

    LIB-NAME

  • lib-ver: string

    LIB-VER

  • db: integer

    DB

  • capa: string

    CAPA: connections with the capability, e.g. redirect.

  • ip: string

    IP

  • not-id: list<integer>

    NOT-ID client-id [ client-id ... ]

  • not-type: client-type

    NOT-TYPE

  • not-user: string

    NOT-USER

  • not-addr: string

    NOT-ADDR

  • not-laddr: string

    NOT-LADDR

  • not-name: string

    NOT-NAME

  • not-flags: string

    NOT-FLAGS

  • not-lib-name: string

    NOT-LIB-NAME

  • not-lib-ver: string

    NOT-LIB-VER

  • not-db: integer

    NOT-DB

  • not-capa: string

    NOT-CAPA

  • not-ip: string

    NOT-IP

use enum client-pause-modesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Which commands CLIENT PAUSE suspends.

  • write

    WRITE: commands that may write.

  • all

    ALL: every command, the default.

use enum client-unblock-typesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How CLIENT UNBLOCK unblocks a connection.

  • timeout

    TIMEOUT: as if the command timed out, the default.

  • error

    ERROR: with an UNBLOCKED error.

use variant cluster-bumpepoch-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The outcome of CLUSTER BUMPEPOCH.

  • bumped: integer

    BUMPED: the config epoch was advanced, to this one.

  • still: integer

    STILL: the config epoch is already the greatest in the cluster, this one.

use enum cluster-failover-modesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How CLUSTER FAILOVER fails over.

  • force

    FORCE: without the agreement of the primary, which may be down.

  • takeover

    TAKEOVER: without the agreement of the primary or the rest of the cluster.

use enum cluster-getslotmigrations-operationsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Which way a slot migration moves the slots.

  • import

    IMPORT: to this node.

  • export

    EXPORT: from this node.

use record cluster-getslotmigrations-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A slot migration, see cluster-getslotmigrations.

  • link-name: string

    The ID of the migration.

  • operation: cluster-getslotmigrations-operation
  • slot-ranges: list<tuple<u16, u16>>

    The ranges of slots, start and end both included.

  • target-node: string

    The ID of the node the slots move to.

  • source-node: string

    The ID of the node the slots move from.

  • create-time: unix-time-seconds
  • last-update-time: unix-time-seconds
  • last-ack-time: unix-time-seconds
  • state: string

    The state of the migration, for people to read.

  • message: string

    More details of the state, for people to read.

  • cow-size: integer

    The bytes copied on write while forked for the migration.

use record cluster-migrateslots-groupsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Ranges of slots to migrate to a node, see cluster-migrateslots.

  • ranges: list<tuple<u16, u16>>

    The ranges of slots, start and end both included.

  • node-id: string

    The ID of the node to migrate the slots to.

  • auth: option<tuple<string, string>>

    AUTH username password: the credentials for the node, since Valkey 9.2.

use enum cluster-reset-modesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How CLUSTER RESET resets a node.

  • hard

    HARD: also generates a new node ID and resets the epochs.

  • soft

    SOFT: the default.

use variant cluster-setslot-statesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The state to set a slot to, see cluster-setslot.

  • importing: string

    IMPORTING node-id: importing the slot from the node.

  • migrating: string

    MIGRATING node-id: migrating the slot to the node.

  • node: string

    NODE node-id: assigned to the node.

  • stable

    STABLE: neither importing nor migrating.

use enum commandlog-typesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A command log, see commandlog-get.

  • slow

    slow: commands that took longer than commandlog-execution-slower-than.

  • large-request

    large-request: commands larger than commandlog-request-larger-than.

  • large-reply

    large-reply: replies larger than commandlog-reply-larger-than.

use record commandlog-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

An entry of the slow log or a command log.

  • id: integer

    The ID of the entry, unique until the server restarts.

  • timestamp: unix-time-seconds

    When the command ran.

  • value: integer

    The microseconds the command took, or for the large logs, the bytes of the request or reply.

  • arguments: list<string>

    The command and its arguments, long ones shortened.

  • client-address: string

    The client's address, ip:port.

  • client-name: string

    The client's name, see CLIENT SETNAME, empty when it has none.

use record slowlog-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

An entry of the slow log or a command log.

  • id: integer

    The ID of the entry, unique until the server restarts.

  • timestamp: unix-time-seconds

    When the command ran.

  • value: integer

    The microseconds the command took, or for the large logs, the bytes of the request or reply.

  • arguments: list<string>

    The command and its arguments, long ones shortened.

  • client-address: string

    The client's address, ip:port.

  • client-name: string

    The client's name, see CLIENT SETNAME, empty when it has none.

use record failover-targetsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Where FAILOVER fails over to.

  • host: string
  • port: u16
  • force: bool

    FORCE: fails over at the timeout, even before the replica has caught up.

use record latency-histogram-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The latency histogram of a command, see latency-histogram.

  • calls: integer

    The number of times the command ran.

  • histogram-usec: list<tuple<integer, integer>>

    The cumulative counts of the calls that took up to each number of microseconds, a power of 2.

use record latency-latest-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The latest sample of the latency of an event, see latency-latest.

use record module-list-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A loaded module, see module-list.

  • name: string
  • ver: integer

    The module's version.

  • path: string

    The path the module was loaded from.

  • args: list<string>

    The arguments the module was loaded with.

use record role-primary-replicasince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A replica of a primary, see role.

  • ip: string
  • port: u16
  • offset: integer

    The replication offset the replica last acknowledged.

use record role-primarysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The replication state of a primary, see role.

use record role-replicasince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The replication state of a replica, see role.

  • primary-host: string
  • primary-port: u16
  • state: string

    The state of replication, e.g. connected, connecting or sync.

  • offset: integer

    The replication offset of the data received from the primary, -1 when not connected.

use variant role-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The server's role in replication, see role.

  • primary: role-primary

    master

  • replica: role-replica

    slave

  • sentinel: list<string>

    sentinel: the names of the primaries it monitors.

use flags shutdown-flagssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The modifiers of SHUTDOWN.

  • now

    NOW: does not wait for lagging replicas.

  • force

    FORCE: ignores errors that would prevent the shutdown, e.g. failing to save.

  • safe

    SAFE: refuses to shut down while it would lose the cluster's quorum of primaries.

  • failover

    FAILOVER: fails over to a replica first.

use enum shutdown-savesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Whether SHUTDOWN saves to disk.

  • nosave

    NOSAVE: does not save, even with save points configured.

  • save

    SAVE: saves, even without save points configured.

use record acl-list-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A user and its rules, see acl-list.

  • username: string
  • rules: list<acl-rule>

    The user's rules, as the server normalized them, e.g. allkeys is ~*. Applied with acl-setuser, after reset, they recreate the user.

use variant acl-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule of an ACL user, see acl-setuser.

https://valkey.io/topics/acl/

  • keys: acl-key-rule

    The keys the user may access.

  • channel: acl-channel-rule

    The Pub/Sub channels the user may access.

  • command: acl-command-rule

    The commands the user may call.

  • db: acl-db-rule

    The databases the user may access.

  • user: acl-user-rule

    The user itself, e.g. whether it is enabled and its passwords.

  • other: string

    A rule this interface does not know, e.g. from a newer server, sent as is.

use variant acl-selector-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule of a selector, a set of permissions matched independently of the user's root permissions, the user may run a command when either permits it.

  • keys: acl-key-rule

    The keys the selector permits access to.

  • channel: acl-channel-rule

    The Pub/Sub channels the selector permits access to.

  • command: acl-command-rule

    The commands the selector permits.

  • db: acl-db-rule

    The databases the selector permits access to.

  • other: string

    A rule this interface does not know, e.g. from a newer server, sent as is.

use variant acl-key-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule for the keys a user may access.

  • add: string

    ~<pattern>: allows reading and writing the keys matching the glob-style pattern.

  • add-read: string

    %R~<pattern>: allows reading the keys matching the glob-style pattern.

  • add-write: string

    %W~<pattern>: allows writing the keys matching the glob-style pattern.

  • add-read-write: string

    %RW~<pattern>: allows reading and writing the keys matching the glob-style pattern, the same as add.

  • all

    allkeys: allows access to all keys, an alias for ~*.

  • reset

    resetkeys: removes all the allowed key patterns.

use variant acl-channel-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule for the Pub/Sub channels a user may access.

  • add: string

    &<pattern>: allows access to the Pub/Sub channels matching the glob-style pattern.

  • all

    allchannels: allows access to all Pub/Sub channels, an alias for &*.

  • reset

    resetchannels: removes all the allowed channel patterns, disconnecting the user's Pub/Sub clients that can no longer access their channels.

use variant acl-command-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule for the commands a user may call.

  • add: string

    +<command>: allows the command, or a subcommand, e.g. config|get.

  • add-category: string

    +@<category>: allows all the commands in the category, e.g. read, see ACL CAT for the categories.

  • add-first-arg: tuple<string, string>

    +<command>|<first-arg>: allows the command only with the given first argument, e.g. select with 0.

  • all

    allcommands: allows all commands, including those of modules loaded later, an alias for +@all.

  • remove: string

    -<command>: disallows the command, or a subcommand.

  • remove-category: string

    -@<category>: disallows all the commands in the category.

  • reset

    nocommands: disallows all commands, an alias for -@all.

use variant acl-db-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule for the databases a user may access.

  • db: list<u8>

    db=<id>[,<id>...]: allows access to the databases with the given IDs.

  • all

    alldbs: allows access to all databases.

  • reset

    resetdbs: removes all the allowed databases.

use variant acl-user-rulesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A rule for the user itself.

  • on

    on: enables the user, it is possible to authenticate as this user.

  • off

    off: disables the user, it is no longer possible to authenticate as this user, connections already authenticated keep working.

  • nopass

    nopass: removes all the user's passwords, any password then authenticates as the user.

  • sanitize-payload

    sanitize-payload: validates the payloads of the user's RESTORE commands, the default.

  • skip-sanitize-payload

    skip-sanitize-payload: skips validating the payloads of the user's RESTORE commands.

  • password: string

    ><password>: adds the password to the user's passwords.

  • hashed-password: string

    #<hash>: adds a password, by its SHA-256 hash as 64 lowercase hex characters, to the user's passwords.

  • remove-password: string

    <<password>: removes the password from the user's passwords.

  • remove-hashed-password: string

    !<hash>: removes a password, by its SHA-256 hash, from the user's passwords.

  • selector: list<acl-selector-rule>

    (<rule> ...): adds a selector, with the given rules.

  • clearselectors

    clearselectors: removes all the user's selectors.

  • reset

    reset: resets the user to its state when created, disabled, without passwords, keys, channels, commands or selectors.

use variant bit-rangesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

bitmap commands A range of a string, negative from the end, for BITCOUNT and BITPOS.

  • from: integer

    start: the bytes from the start to the end of the string.

  • bytes: tuple<integer, integer>

    start end: the bytes from the start to the end, both included.

  • bits: tuple<integer, integer>

    start end BIT: the bits from the start to the end, both included.

use variant bitfield-encodingsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The type of an integer field of a string, for BITFIELD.

  • signed: u8

    i1 to i64: a signed integer of the width in bits.

  • unsigned: u8

    u1 to u63: an unsigned integer of the width in bits.

use variant bitfield-offsetsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Where an integer field of a string starts, for BITFIELD.

  • bit: u64

    The offset in bits.

  • field: u64

    #field: the field of the encoding's width, the offset in bits is the field times the width.

use enum bitfield-overflowsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

What a write does when the field overflows, OVERFLOW.

  • wrap

    WRAP: wraps around, the default.

  • sat

    SAT: saturates at the minimum or maximum.

  • fail

    FAIL: does not write, the result is none.

use record bitfield-getsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

GET encoding offset: the value of the field.

use record bitfield-ro-getsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

GET encoding offset: the value of the field.

use record bitfield-setsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

SET encoding offset value: sets the field, the result is its previous value.

use record bitfield-incrbysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

INCRBY encoding offset increment: increments the field, the result is its new value.

use variant bitfield-operationsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

An operation of BITFIELD.

A write is preceded by an optional overflow mode, OVERFLOW WRAP | SAT | FAIL, for it and the following writes. None keeps the current mode, WRAP at the start of the command.

use variant bitop-operationsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A bitwise operation of BITOP, and its source keys.

  • and: list<string>

    AND

  • or: list<string>

    OR

  • xor: list<string>

    XOR

  • not: string

    NOT: of a single key.

use record command-key-spec-keywordsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The keyword before the first key, see command-key-spec-begin-search.

  • keyword: string
  • startfrom: integer

    The index of the argument to start searching from, from the end when negative.

use variant command-key-spec-find-keyssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How a key spec finds the keys after the first one, see command-key-spec.

use record command-key-spec-rangesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A range of keys, see command-key-spec-find-keys.

  • lastkey: integer

    The index of the last key, relative to the first, from the end when negative.

  • keystep: integer

    The number of arguments from one key to the next.

  • limit: integer

    With a lastkey of -1, divides the remaining arguments, e.g. 2 for half of them.

use record command-key-spec-keynumsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A number of keys, see command-key-spec-find-keys.

  • keynumidx: integer

    The index of the argument with the number of keys, relative to the first.

  • firstkey: integer

    The index of the first key, relative to the first.

  • keystep: integer

    The number of arguments from one key to the next.

use record command-key-specsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Where a command's keys are and how it uses them.

use record command-info-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A command, see command and command-info.

  • name: string

    The command's name, e.g. get, or for a subcommand, config|get.

  • arity: integer

    The number of arguments, the name included, the minimum when negative.

  • flags: list<string>

    The command's flags, e.g. readonly and fast.

  • first-key: integer

    The index of the first key, 0 for none.

  • last-key: integer

    The index of the last key, from the end when negative.

  • step: integer

    The number of arguments from one key to the next.

  • acl-categories: list<string>

    The ACL categories of the command, e.g. @read.

  • tips: list<string>

    Hints for clients, e.g. nondeterministic_output.

  • key-specs: list<command-key-spec>

use record command-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A command, see command and command-info.

  • name: string

    The command's name, e.g. get, or for a subcommand, config|get.

  • arity: integer

    The number of arguments, the name included, the minimum when negative.

  • flags: list<string>

    The command's flags, e.g. readonly and fast.

  • first-key: integer

    The index of the first key, 0 for none.

  • last-key: integer

    The index of the last key, from the end when negative.

  • step: integer

    The number of arguments from one key to the next.

  • acl-categories: list<string>

    The ACL categories of the command, e.g. @read.

  • tips: list<string>

    Hints for clients, e.g. nondeterministic_output.

  • key-specs: list<command-key-spec>

use variant command-docs-argument-typesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The type of an argument of a command, see command-docs-argument.

  • string

    string

  • integer

    integer

  • double

    double

  • key

    key: a key, see key-spec-index.

  • pattern

    pattern: a glob-style pattern.

  • unix-time

    unix-time

  • pure-token

    pure-token: the token alone, without a value.

  • oneof

    oneof: one of the arguments it contains.

  • block

    block: the arguments it contains, together.

  • other: string

    A type this interface does not know, e.g. from a newer server.

use record command-docs-argumentsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

An argument of a command, see command-docs.

  • parent: option<u32>

    The index of the oneof or block argument containing this one, in the command's arguments, none at the top level.

  • name: string
  • type: command-docs-argument-type
  • display-text: option<string>

    The name to show for the argument.

  • key-spec-index: option<integer>

    The index of the argument's key spec, for a key.

  • token: option<string>

    The token before the argument's value, e.g. EX, or for a pure-token, the token alone.

  • summary: option<string>
  • since: option<string>

    The version that added the argument.

  • deprecated-since: option<string>
  • flags: list<string>

    The argument's flags, e.g. optional, multiple and multiple_token.

use record command-docs-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The documentation of a command, see command-docs.

  • name: string

    The command's name, e.g. get, or for a subcommand, config|get.

  • summary: string
  • since: string

    The version that added the command.

  • group: string

    The command's group, e.g. string.

  • complexity: option<string>

    The command's time complexity, none for a few commands, e.g. MONITOR.

  • module: option<string>

    The module of the command, for a module's command.

  • doc-flags: list<string>

    The command's documentation flags, e.g. deprecated or syscmd.

  • deprecated-since: option<string>
  • replaced-by: option<string>

    The command to use instead, for a deprecated command.

  • history: list<tuple<string, string>>

    The changes to the command, the version of each and what changed.

  • arguments: list<command-docs-argument>

    The arguments, depth first, those an argument contains after it.

use variant client-setinfo-attrsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Information about the library of a connection, see client-setinfo.

  • lib-name: string

    LIB-NAME: the name of the library, e.g. valkey-wasm.

  • lib-ver: string

    LIB-VER: the version of the library.

use enum client-tracking-modesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Which keys tracking tracks without CLIENT CACHING.

  • optin

    OPTIN: none, only those of commands after CLIENT CACHING YES.

  • optout

    OPTOUT: all, except those of commands after CLIENT CACHING NO.

use record client-tracking-optionssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The options of CLIENT TRACKING ON.

  • prefixes: option<list<string>>

    PREFIX prefix: with bcast, only notifies about keys with the prefixes.

  • bcast: bool

    BCAST: notifies about every change of the keys with the prefixes, read or not.

  • mode: option<client-tracking-mode>
  • noloop: bool

    NOLOOP: does not notify about the keys the connection changed itself.

use variant client-trackinginfo-redirectsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Where a connection's tracking notifications are redirected, see client-trackinginfo.

Redirecting is for RESP2, which the connection does not use, but CLIENT TRACKING REDIRECT may still be sent with connection.exchange.

  • not-tracking

    -1: tracking is not on.

  • not-redirected

    0: tracking is on, the notifications are not redirected.

  • redirected: integer

    The ID of the connection the notifications are redirected to.

use record client-trackinginfo-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A connection's tracking state, see client-trackinginfo.

  • flags: list<string>

    The tracking flags, e.g. on, bcast, optin or noloop.

  • redirect: client-trackinginfo-redirect

    Where the notifications are redirected.

  • prefixes: list<string>

    The prefixes of BCAST.

use variant command-list-filtersince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The filter of COMMAND LIST.

  • module: string

    MODULE module-name: the commands of the module.

  • aclcat: string

    ACLCAT category: the commands in the ACL category.

  • pattern: string

    PATTERN pattern: the commands matching the glob-style pattern.

use record geo-coordinatessince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

geo commands A position on the Earth.

The exact limits, as specified by EPSG:900913 / EPSG:3785 / OSGEO:41001

  • longitude: double

    The longitude, from -180 to 180 degrees.

  • latitude: double

    The latitude, from -85.05112878 to 85.05112878 degrees.

use enum geo-unitsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A unit of distance.

  • m

    m: meters.

  • km

    km: kilometers.

  • ft

    ft: feet.

  • mi

    mi: miles.

use enum geoadd-conditionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Only add or only update members, GEOADD's NX and XX.

  • nx

    Only add new members, never update existing ones.

  • xx

    Only update existing members, never add new ones.

use variant geosearch-fromsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The center of a search, FROMMEMBER or FROMLONLAT.

use record geosearch-radiussince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

BYRADIUS: a circle around the center.

use record geosearch-boxsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

BYBOX: a rectangle around the center.

use variant geosearch-shapesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The area of a search.

  • radius: geosearch-radius

    [ FROMMEMBER member | FROMLONLAT longitude latitude ] BYRADIUS radius unit

  • box: geosearch-box

    [ FROMMEMBER member | FROMLONLAT longitude latitude ] BYBOX width height unit

  • polygon: list<geo-coordinates>

    BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ]: the polygon with the vertices, in order, which has no center.

use variant geosearchstore-shapesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The area of a search.

  • radius: geosearch-radius

    [ FROMMEMBER member | FROMLONLAT longitude latitude ] BYRADIUS radius unit

  • box: geosearch-box

    [ FROMMEMBER member | FROMLONLAT longitude latitude ] BYBOX width height unit

  • polygon: list<geo-coordinates>

    BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ]: the polygon with the vertices, in order, which has no center.

use record geosearch-countsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

At most a count of the members, COUNT count [ ANY ].

  • count: integer
  • any: bool

    ANY: returns as soon as enough members are found, rather than the nearest ones.

use record geosearchstore-countsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

At most a count of the members, COUNT count [ ANY ].

  • count: integer
  • any: bool

    ANY: returns as soon as enough members are found, rather than the nearest ones.

use flags geosearch-with-flagssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The details GEOSEARCH returns of each member it found.

  • withcoord

    WITHCOORD: the position.

  • withdist

    WITHDIST: the distance from the center.

  • withhash

    WITHHASH: the geohash, as an integer.

use record geosearch-with-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A member a search found, with the details asked for.

  • member: string-or-bytes
  • distance: option<double>

    WITHDIST: the distance from the center, in the unit of the shape.

  • hash: option<integer>

    WITHHASH: the geohash, as an integer.

  • coordinates: option<geo-coordinates>

    WITHCOORD: the position.

use enum hpersist-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

hash commands The outcome of removing the expiration of a hash field.

  • does-not-exist

    -2: the field does not exist, or the hash does not exist.

  • no-expiration

    -1: the field exists, but has no expiration.

  • removed

    1: the expiration was removed.

use enum hsetex-conditionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Only set the fields when the hash does, or does not, exist, HSETEX's NX and XX.

  • nx

    Only set the fields when the hash does not exist.

  • xx

    Only set the fields when the hash exists.

use enum hsetex-field-conditionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Only set the fields when none, or all, of them exist, HSETEX's FNX and FXX.

  • fnx

    Only set the fields when none of them exist.

  • fxx

    Only set the fields when all of them exist.

use variant key-typesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The type of the value stored at a key.

  • string

    string

  • list

    list

  • set

    set

  • zset

    zset: a sorted set.

  • hash

    hash

  • stream

    stream

  • other: string

    The type of a module, by name.

use flags migrate-flagssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The options of MIGRATE.

  • copy

    COPY: keeps the keys in this instance.

  • replace

    REPLACE: replaces keys that exist in the other instance.

use variant migrate-authsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The credentials to authenticate to the other instance with, for MIGRATE.

  • password: string

    AUTH password

  • username-password: tuple<string, string>

    AUTH2 username password

use enum list-sidesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

list commands An end of a list.

  • left

    LEFT: the head, the first element.

  • right

    RIGHT: the tail, the last element.

use enum linsert-positionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Where LINSERT inserts an element, relative to the pivot.

  • before

    BEFORE: in front of the pivot.

  • after

    AFTER: behind the pivot.

use variant linsert-resultsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The outcome of LINSERT.

  • inserted: integer

    The element was inserted, the length of the list after it.

  • no-such-key

    0: the key does not exist, nothing was inserted.

  • pivot-not-found

    -1: the pivot is not in the list, nothing was inserted.

use enum flush-modesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Whether a flush happens in the background, ASYNC, or before replying, SYNC.

  • async

    ASYNC

  • sync

    SYNC

use record function-list-functionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A function of a library.

  • name: string
  • description: option<string>
  • flags: list<string>

    The function's flags, e.g. no-writes.

use record function-list-librarysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A library of functions.

  • library-name: string
  • engine: string

    The engine that runs the library, e.g. LUA.

  • functions: list<function-list-function>
  • library-code: option<string>

    The library's source code, with withcode.

use record function-stats-runningsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The function that is running.

  • name: string
  • command: list<string>

    The command and its arguments that called the function.

  • duration: duration-milliseconds

    How long the function has been running.

use record function-stats-enginesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The libraries and functions of an engine.

use record function-stats-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The function that is running, and the libraries and functions of each engine.

use record limitsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A range of a sorted result, LIMIT offset count.

  • offset: integer

    The number of elements skipped.

  • count: integer

    The maximum number of elements returned, negative for all of them.

use record sort-optssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How SORT orders and projects the elements of a list, set or sorted set.

  • by: option<string>

    BY pattern: sorts by the values of the keys the pattern names, * replaced with each element, or nosort to skip sorting.

  • limit: option<limit>

    LIMIT offset count: a range of the sorted elements.

  • get: option<list<string>>

    GET pattern: returns the values of the keys each pattern names instead of the elements, # for the element itself.

  • order: option<sort-order>

    order to sort elements.

  • alpha: bool

    ALPHA: sorts lexicographically, rather than numerically.

use record sort-ro-optssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How SORT orders and projects the elements of a list, set or sorted set.

  • by: option<string>

    BY pattern: sorts by the values of the keys the pattern names, * replaced with each element, or nosort to skip sorting.

  • limit: option<limit>

    LIMIT offset count: a range of the sorted elements.

  • get: option<list<string>>

    GET pattern: returns the values of the keys each pattern names instead of the elements, # for the element itself.

  • order: option<sort-order>

    order to sort elements.

  • alpha: bool

    ALPHA: sorts lexicographically, rather than numerically.

use enum sort-ordersince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

  • asc

    ascending, smallest to largest.

  • desc

    descending, largest to smallest.

use variant score-boundsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

sortedset commands A bound of a range of scores.

  • inclusive: double

    The score, included in the range.

  • exclusive: double

    (score: the score, excluded from the range.

  • unbounded

    -inf as the min, +inf as the max, the start is the max with REV.

use variant lex-boundsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A bound of a range of members, for members of equal score, ordered lexicographically.

  • inclusive: string-or-bytes

    [member: the member, included in the range.

  • exclusive: string-or-bytes

    (member: the member, excluded from the range.

  • unbounded

    - as the min, + as the max, the start is the max with REV.

use enum zmpop-endsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Which end of a sorted set to pop from.

  • min

    The members with the lowest scores.

  • max

    The members with the highest scores.

use enum bzmpop-endsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Which end of a sorted set to pop from.

  • min

    The members with the lowest scores.

  • max

    The members with the highest scores.

use enum zset-aggregatesince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How scores combine for a member in several sorted sets.

  • sum

    The sum of the weighted scores, the default.

  • min

    The lowest weighted score.

  • max

    The highest weighted score.

use variant zrange-bysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The range of ZRANGE and ZRANGESTORE, start and stop, given as they are sent: with REV, the higher bound first.

use variant zrangestore-bysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The range of ZRANGE and ZRANGESTORE, start and stop, given as they are sent: with REV, the higher bound first.

use variant zrange-withscores-bysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The range of ZRANGE WITHSCORES, which does not support BYLEX, see zrange-by.

use enum zadd-conditionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Only update or only add members, ZADD's NX and XX.

  • nx

    Only add new members, never update existing ones.

  • xx

    Only update existing members, never add new ones.

use enum zadd-comparisonsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Only update a member's score when the new score is greater or less, ZADD's GT and LT.

  • gt

    Only update when the new score is greater than the current one.

  • lt

    Only update when the new score is less than the current one.

use type stream-idsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

stream commands The ID of a stream entry, <milliseconds-time>-<sequence-number>, e.g. 1526919030474-55.

Commands that add an entry also accept *, for the server to generate the ID.

  • string

use variant stream-trimsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How a stream is trimmed, e.g. with XADD or XTRIM.

  • maxlen: stream-trim-maxlen

    Evicts entries as long as the stream's length exceeds the specified threshold, where threshold is a positive integer.

  • minid: stream-trim-minid

    Evicts entries with IDs lower than threshold, where threshold is a stream ID.

use record stream-trim-maxlensince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Trims the stream to a maximum length, MAXLEN [ = | ~ ] threshold [ LIMIT count ].

  • efficiency: option<stream-trim-efficiency>

    Exact, =, when none.

  • threshold: integer

    The maximum number of entries kept.

  • limit: option<integer>

    The maximum number of entries evicted, only with nearly exact trimming, 0 for no limit.

use record stream-trim-minidsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Trims the entries with lower IDs, MINID [ = | ~ ] threshold [ LIMIT count ].

  • efficiency: option<stream-trim-efficiency>

    Exact, =, when none.

  • threshold: stream-id

    The lowest ID kept.

  • limit: option<integer>

    The maximum number of entries evicted, only with nearly exact trimming, 0 for no limit.

use enum stream-trim-efficiencysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

How exactly a stream is trimmed. Nearly exact trimming is more efficient, the stream may keep a few entries more than the threshold.

  • exact

    =: exact trimming

  • mearly-exact

    ~: nearly exact trimming

use record xclaim-optssince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Options of XCLAIM.

  • idle: option<duration-milliseconds>

    IDLE ms: sets the idle time of the entries, the time since they were last delivered, instead of resetting it.

  • time: option<unix-time-milliseconds>

    TIME unix-time-milliseconds: sets the idle time of the entries to the time since this instant.

  • retrycount: option<integer>

    RETRYCOUNT count: sets the delivery count of the entries, instead of incrementing it.

  • force: bool

    FORCE: claims the entries even when they are not pending for any consumer, as long as they exist in the stream.

  • lastid: option<stream-id>

    LASTID lastid: sets the ID of the last entry delivered to the group.

use record xinfo-consumers-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A consumer of a group, see xinfo-consumers.

  • name: string

    The consumer's name.

  • pending: integer

    The number of entries pending for the consumer.

  • idle: duration-milliseconds

    The time since the consumer last attempted an interaction, e.g. XREADGROUP, XCLAIM or XAUTOCLAIM.

  • inactive: option<duration-milliseconds>

    The time since the consumer last interacted successfully, e.g. read or claimed entries. None when the consumer has never been active.

use record xinfo-groups-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A consumer group of a stream, see xinfo-groups.

  • name: string

    The group's name.

  • consumers: integer

    The number of consumers in the group.

  • pending: integer

    The number of entries in the group's pending entries list (PEL), delivered but not acknowledged.

  • last-delivered-id: stream-id

    The ID of the last entry delivered to the group's consumers.

  • entries-read: option<integer>

    The logical read counter of the last entry delivered to the group's consumers, none when unknown.

  • lag: option<integer>

    The number of entries in the stream not yet delivered to the group's consumers, none when it cannot be determined.

use record xinfo-stream-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Information about a stream, see xinfo-stream.

  • length: integer

    The number of entries in the stream.

  • radix-tree-keys: integer

    The number of keys in the radix tree storing the stream.

  • radix-tree-nodes: integer

    The number of nodes in the radix tree storing the stream.

  • groups: integer

    The number of consumer groups of the stream.

  • last-generated-id: option<stream-id>

    The ID of the last entry added to the stream, none when no entry was ever added.

  • max-deleted-entry-id: option<stream-id>

    The highest ID deleted from the stream, none when no entry was ever deleted.

  • entries-added: integer

    The number of entries added to the stream over its lifetime.

  • first-entry: option<tuple<stream-id, map<string, string-or-bytes>>>

    The ID and fields of the first entry. None when the stream is empty.

  • last-entry: option<tuple<stream-id, map<string, string-or-bytes>>>

    The ID and fields of the last entry. None when the stream is empty.

use record xinfo-stream-reply-fullsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Information about a stream, its entries and consumer groups, see xinfo-stream-full.

  • length: integer

    The number of entries in the stream.

  • radix-tree-keys: integer

    The number of keys in the radix tree storing the stream.

  • radix-tree-nodes: integer

    The number of nodes in the radix tree storing the stream.

  • last-generated-id: option<stream-id>

    The ID of the last entry added to the stream, none when no entry was ever added.

  • max-deleted-entry-id: option<stream-id>

    The highest ID deleted from the stream, none when no entry was ever deleted.

  • entries-added: integer

    The number of entries added to the stream over its lifetime.

  • entries: list<tuple<stream-id, map<string, string-or-bytes>>>

    The ID and fields of the entries, in ascending ID order, up to the count given.

  • groups: list<xinfo-stream-reply-full-group>

    The consumer groups of the stream.

use record xinfo-stream-reply-full-groupsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A consumer group of a stream, with its pending entries and consumers.

  • name: string

    The group's name.

  • last-delivered-id: stream-id

    The ID of the last entry delivered to the group's consumers.

  • entries-read: option<integer>

    The logical read counter of the last entry delivered to the group's consumers, none when unknown.

  • lag: option<integer>

    The number of entries in the stream not yet delivered to the group's consumers, none when it cannot be determined.

  • pel-count: integer

    The number of entries in the group's pending entries list (PEL), delivered but not acknowledged.

  • pending: list<tuple<stream-id, string, unix-time-milliseconds, integer>>

    The group's pending entries, the ID of each, the consumer it was delivered to, when it was last delivered and the number of times it was delivered.

  • consumers: list<xinfo-stream-reply-full-consumer>

    The group's consumers.

use record xinfo-stream-reply-full-consumersince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A consumer of a group, with its pending entries.

  • name: string

    The consumer's name.

  • seen-time: unix-time-milliseconds

    When the consumer last attempted an interaction, e.g. XREADGROUP, XCLAIM or XAUTOCLAIM.

  • active-time: option<unix-time-milliseconds>

    When the consumer last interacted successfully, e.g. read or claimed entries. None when the consumer has never been active.

  • pel-count: integer

    The number of entries pending for the consumer, delivered but not acknowledged.

  • pending: list<tuple<stream-id, unix-time-milliseconds, integer>>

    The consumer's pending entries, the ID of each, when it was last delivered and the number of times it was delivered.

use record xpending-summarysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The pending entries of a consumer group, see xpending.

  • count: integer

    The number of pending entries.

  • lowest-id: option<stream-id>

    The lowest ID of the pending entries, none when there are none.

  • highest-id: option<stream-id>

    The highest ID of the pending entries, none when there are none.

  • consumers: list<tuple<string, integer>>

    Each consumer with pending entries, and how many it has.

use record xpending-extended-entrysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The pending entries of a consumer group, see xpending-extended.

  • id: stream-id

    The ID of the message.

  • name: string

    The name of the consumer that fetched the message and has still to acknowledge it. We call it the current owner of the message.

  • since-delivery: duration-milliseconds

    The number of milliseconds that elapsed since the last time this message was delivered to this consumer.

  • delivery-count: integer

    The number of times this message was delivered.

use variant getex-ttlsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

string commands The expiration to set on a key, see getex.

  • ex: duration-seconds

    Set the specified expire time, in seconds.

  • px: duration-milliseconds

    Set the specified expire time, in milliseconds.

  • exat: unix-time-seconds

    Set the specified Unix time at which the key will expire, in seconds.

  • pxat: unix-time-milliseconds

    Set the specified Unix time at which the key will expire, in milliseconds.

  • persist

    Remove the time to live associated with the key.

use variant hgetex-ttlsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

string commands The expiration to set on a key, see getex.

  • ex: duration-seconds

    Set the specified expire time, in seconds.

  • px: duration-milliseconds

    Set the specified expire time, in milliseconds.

  • exat: unix-time-seconds

    Set the specified Unix time at which the key will expire, in seconds.

  • pxat: unix-time-milliseconds

    Set the specified Unix time at which the key will expire, in milliseconds.

  • persist

    Remove the time to live associated with the key.

use record lcs-idx-replysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The longest common subsequence of two strings, as the ranges matching in each, see lcs-idx.

  • matches: list<lcs-idx-match>

    The ranges that match, from the end of the strings to their start.

  • len: integer

    The length of the longest common subsequence.

use record lcs-idx-matchsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

A part of the longest common subsequence.

  • key1-range: tuple<integer, integer>

    The inclusive start and end positions of the match in the first key's string.

  • key2-range: tuple<integer, integer>

    The inclusive start and end positions of the match in the second key's string.

  • len: option<integer>

    The length of the match, with with-match-len.

use variant msetex-preconditionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The condition for setting the keys, see msetex.

  • nx

    Only set the keys if all of them do not already exist.

  • xx

    Only set the keys if all of them already exist.

use variant msetex-ttlsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The expiration to set on a key, see set.

  • ex: duration-seconds

    Set the specified expire time, in seconds.

  • px: duration-milliseconds

    Set the specified expire time, in milliseconds.

  • exat: unix-time-seconds

    Set the specified Unix time at which the key will expire, in seconds.

  • pxat: unix-time-milliseconds

    Set the specified Unix time at which the key will expire, in milliseconds.

  • keepttl

    Retain the time to live associated with the keys.

use variant set-preconditionsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The condition for setting a key, see set.

  • nx

    Only set the key if it does not already exist.

  • xx

    Only set the key if it already exists.

  • ifeq: string-or-bytes

    Set the key if the comparison value matches the existing value.

  • ifne: string-or-bytes

    Set the key if the comparison value does not match the existing value.

use variant set-ttlsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The expiration to set on a key, see set.

  • ex: duration-seconds

    Set the specified expire time, in seconds.

  • px: duration-milliseconds

    Set the specified expire time, in milliseconds.

  • exat: unix-time-seconds

    Set the specified Unix time at which the key will expire, in seconds.

  • pxat: unix-time-milliseconds

    Set the specified Unix time at which the key will expire, in milliseconds.

  • keepttl

    Retain the time to live associated with the keys.

use variant hsetex-ttlsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

The expiration to set on a key, see set.

  • ex: duration-seconds

    Set the specified expire time, in seconds.

  • px: duration-milliseconds

    Set the specified expire time, in milliseconds.

  • exat: unix-time-seconds

    Set the specified Unix time at which the key will expire, in seconds.

  • pxat: unix-time-milliseconds

    Set the specified Unix time at which the key will expire, in milliseconds.

  • keepttl

    Retain the time to live associated with the keys.

use type bytessince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

Raw bytes, e.g. a bulk string, which Valkey keeps as given, UTF-8 or not.

  • list<u8>

use variant string-or-bytessince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

  • string: string

    utf-8 decoded bytes.

  • bytes: bytes

    bytes that cannot be represented as a utf-8 string.

use variant restore-ttlsince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

keyspace commands The expiration of a key restore creates.

use enum function-restore-policysince 0.3.0-dev

from componentized:valkey/types@0.3.0-dev

scripting commands What function-restore does with the libraries already loaded.

  • flush

    FLUSH: deletes them first.

  • append

    APPEND: keeps them, failing when a library of the same name is loaded.

  • replace

    REPLACE: keeps them, replacing those with a library of the same name.

Functions

async functionacl-cat: async func( connection: borrow<connection>, category: option<string>, ) -> result<list<string>, error-code>since 0.3.0-dev

Lists the ACL categories, or the commands inside a category.

ACL CAT [ category ] https://valkey.io/commands/acl-cat/

async functionacl-deluser: async func( connection: borrow<connection>, usernames: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Deletes ACL users, and terminates their connections.

ACL DELUSER username [ username ... ] https://valkey.io/commands/acl-deluser/

async functionacl-dryrun: async func( connection: borrow<connection>, username: string, command: list<string>, ) -> result<acl-dryrun-result, error-code>since 0.3.0-dev

Simulates the execution of a command by a user, without executing the command.

ACL DRYRUN username command [ arg [ arg ... ] ] https://valkey.io/commands/acl-dryrun/

async functionacl-genpass: async func( connection: borrow<connection>, bits: option<integer>, ) -> result<string, error-code>since 0.3.0-dev

Generates a pseudorandom, secure password that can be used to identify ACL users.

ACL GENPASS [ bits ] https://valkey.io/commands/acl-genpass/

async functionacl-getuser: async func( connection: borrow<connection>, username: string, ) -> result<option<list<acl-rule>>, error-code>since 0.3.0-dev

Lists the ACL rules of a user.

None when the user does not exist. The rules are as the server normalized them, e.g. allkeys is ~*. Applied with acl-setuser, after reset, they recreate the user.

ACL GETUSER username https://valkey.io/commands/acl-getuser/

async functionacl-list: async func( connection: borrow<connection>, ) -> result<list<acl-list-entry>, error-code>since 0.3.0-dev

Dumps the effective rules in ACL file format.

ACL LIST https://valkey.io/commands/acl-list/

async functionacl-load: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Reloads the rules from the configured ACL file.

ACL LOAD https://valkey.io/commands/acl-load/

async functionacl-log: async func( connection: borrow<connection>, count: option<integer>, ) -> result<list<acl-log-entry>, error-code>since 0.3.0-dev

Lists recent security events generated due to ACL rules.

See also acl-log-reset.

ACL LOG [ count ] https://valkey.io/commands/acl-log/

async functionacl-log-reset: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Lists recent security events generated due to ACL rules.

The RESET form, clearing the security events.

See also acl-log.

ACL LOG RESET https://valkey.io/commands/acl-log/

async functionacl-save: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Saves the effective ACL rules in the configured ACL file.

ACL SAVE https://valkey.io/commands/acl-save/

async functionacl-setuser: async func( connection: borrow<connection>, username: string, rules: option<list<acl-rule>>, ) -> result<_, error-code>since 0.3.0-dev

Creates and modifies an ACL user and its rules.

ACL SETUSER username [ rule ] [ [ rule ] ... ] https://valkey.io/commands/acl-setuser/

async functionacl-users: async func( connection: borrow<connection>, ) -> result<list<string>, error-code>since 0.3.0-dev

Lists all ACL users.

ACL USERS https://valkey.io/commands/acl-users/

async functionacl-whoami: async func( connection: borrow<connection>, ) -> result<string, error-code>since 0.3.0-dev

Returns the authenticated username of the current connection.

ACL WHOAMI https://valkey.io/commands/acl-whoami/

async functionbgrewriteaof: async func( connection: borrow<connection>, ) -> result<string, error-code>since 0.3.0-dev

Asynchronously rewrites the append-only file to disk.

BGREWRITEAOF https://valkey.io/commands/bgrewriteaof/

async functionbgsave: async func( connection: borrow<connection>, operation: option<bgsave-operation>, ) -> result<string, error-code>since 0.3.0-dev

Asynchronously saves the database(s) to disk.

BGSAVE [ SCHEDULE | CANCEL ] https://valkey.io/commands/bgsave/

async functionclient-kill: async func( connection: borrow<connection>, filters: list<client-filter>, ) -> result<integer, error-code>since 0.3.0-dev

Terminates open connections.

CLIENT KILL filter [ filter ... ] https://valkey.io/commands/client-kill/

async functionclient-list: async func( connection: borrow<connection>, filters: option<list<client-filter>>, ) -> result<list<map<string, string>>, error-code>since 0.3.0-dev

Lists open connections.

Each connection is a map of its fields, parsed from the server's text, e.g. id, addr and name.

CLIENT LIST [ filter [ filter ... ] ] https://valkey.io/commands/client-list/

async functionclient-no-evict: async func( connection: borrow<connection>, enabled: bool, ) -> result<_, error-code>since 0.3.0-dev

Sets the client eviction mode of the connection.

It applies to the connection, so to every caller sharing it.

CLIENT NO-EVICT 〈 ON | OFF 〉 https://valkey.io/commands/client-no-evict/

async functionclient-pause: async func( connection: borrow<connection>, timeout: duration-milliseconds, mode: option<client-pause-mode>, ) -> result<_, error-code>since 0.3.0-dev

Suspends commands processing.

CLIENT PAUSE timeout [ WRITE | ALL ] https://valkey.io/commands/client-pause/

async functionclient-unblock: async func( connection: borrow<connection>, client-id: integer, unblock-type: option<client-unblock-type>, ) -> result<bool, error-code>since 0.3.0-dev

Unblocks a client blocked by a blocking command from a different connection.

CLIENT UNBLOCK client-id [ TIMEOUT | ERROR ] https://valkey.io/commands/client-unblock/

async functionclient-unpause: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Resumes processing commands from paused clients.

CLIENT UNPAUSE https://valkey.io/commands/client-unpause/

async functioncluster-addslots: async func( connection: borrow<connection>, slots: list<u16>, ) -> result<_, error-code>since 0.3.0-dev

Assigns new hash slots to a node.

CLUSTER ADDSLOTS slot [ slot ... ] https://valkey.io/commands/cluster-addslots/

async functioncluster-addslotsrange: async func( connection: borrow<connection>, ranges: list<tuple<u16, u16>>, ) -> result<_, error-code>since 0.3.0-dev

Assigns new hash slot ranges to a node.

CLUSTER ADDSLOTSRANGE start-slot end-slot [ start-slot end-slot ... ] https://valkey.io/commands/cluster-addslotsrange/

async functioncluster-bumpepoch: async func( connection: borrow<connection>, ) -> result<cluster-bumpepoch-result, error-code>since 0.3.0-dev

Advances the cluster config epoch.

CLUSTER BUMPEPOCH https://valkey.io/commands/cluster-bumpepoch/

async functioncluster-cancelslotmigrations: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Cancel all current ongoing slot migration operations.

CLUSTER CANCELSLOTMIGRATIONS https://valkey.io/commands/cluster-cancelslotmigrations/

async functioncluster-count-failure-reports: async func( connection: borrow<connection>, node-id: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of active failure reports for a node.

CLUSTER COUNT-FAILURE-REPORTS node-id https://valkey.io/commands/cluster-count-failure-reports/

async functioncluster-delslots: async func( connection: borrow<connection>, slots: list<u16>, ) -> result<_, error-code>since 0.3.0-dev

Sets hash slots as unbound for a node.

CLUSTER DELSLOTS slot [ slot ... ] https://valkey.io/commands/cluster-delslots/

async functioncluster-delslotsrange: async func( connection: borrow<connection>, ranges: list<tuple<u16, u16>>, ) -> result<_, error-code>since 0.3.0-dev

Sets hash slot ranges as unbound for a node.

CLUSTER DELSLOTSRANGE start-slot end-slot [ start-slot end-slot ... ] https://valkey.io/commands/cluster-delslotsrange/

async functioncluster-failover: async func( connection: borrow<connection>, mode: option<cluster-failover-mode>, ) -> result<_, error-code>since 0.3.0-dev

Forces a replica to perform a manual failover of its primary.

CLUSTER FAILOVER [ FORCE | TAKEOVER ] https://valkey.io/commands/cluster-failover/

async functioncluster-flushslots: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Deletes all slots information from a node.

CLUSTER FLUSHSLOTS https://valkey.io/commands/cluster-flushslots/

async functioncluster-forget: async func( connection: borrow<connection>, node-id: string, ) -> result<_, error-code>since 0.3.0-dev

Removes a node from the nodes table.

CLUSTER FORGET node-id https://valkey.io/commands/cluster-forget/

async functioncluster-getslotmigrations: async func( connection: borrow<connection>, ) -> result<list<cluster-getslotmigrations-entry>, error-code>since 0.3.0-dev

Gets the status of ongoing and recently finished slot import and export operations.

CLUSTER GETSLOTMIGRATIONS https://valkey.io/commands/cluster-getslotmigrations/

async functioncluster-meet: async func( connection: borrow<connection>, ip: string, port: u16, cluster-bus-port: option<u16>, ) -> result<_, error-code>since 0.3.0-dev

Forces a node to handshake with another node.

CLUSTER MEET ip port [ cluster-bus-port ] https://valkey.io/commands/cluster-meet/

async functioncluster-migrateslots: async func( connection: borrow<connection>, migrations: list<cluster-migrateslots-group>, ) -> result<_, error-code>since 0.3.0-dev

Migrate the given slots from this node to the specified nodes.

CLUSTER MIGRATESLOTS SLOTSRANGE start-slot end-slot [ start-slot end-slot ... ] NODE node-id [ AUTH username password ] [ SLOTSRANGE ... ] https://valkey.io/commands/cluster-migrateslots/

async functioncluster-replicas: async func( connection: borrow<connection>, node-id: string, ) -> result<list<string>, error-code>since 0.3.0-dev

Lists the replica nodes of a primary node.

CLUSTER REPLICAS node-id https://valkey.io/commands/cluster-replicas/

async functioncluster-replicate: async func( connection: borrow<connection>, node-id: option<string>, ) -> result<_, error-code>since 0.3.0-dev

Configures a node as replica of a primary node or detaches a replica from its primary.

None detaches the node from its primary, NO ONE.

CLUSTER REPLICATE 〈 node-id | NO ONE 〉 https://valkey.io/commands/cluster-replicate/

async functioncluster-reset: async func( connection: borrow<connection>, mode: option<cluster-reset-mode>, ) -> result<_, error-code>since 0.3.0-dev

Resets a node.

CLUSTER RESET [ HARD | SOFT ] https://valkey.io/commands/cluster-reset/

async functioncluster-saveconfig: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Forces a node to save the cluster configuration to disk.

CLUSTER SAVECONFIG https://valkey.io/commands/cluster-saveconfig/

async functioncluster-set-config-epoch: async func( connection: borrow<connection>, config-epoch: integer, ) -> result<_, error-code>since 0.3.0-dev

Sets the configuration epoch for a new node.

CLUSTER SET-CONFIG-EPOCH config-epoch https://valkey.io/commands/cluster-set-config-epoch/

async functioncluster-setslot: async func( connection: borrow<connection>, slot: u16, state: cluster-setslot-state, timeout: option<duration-milliseconds>, ) -> result<_, error-code>since 0.3.0-dev

Binds a hash slot to a node.

CLUSTER SETSLOT slot 〈 IMPORTING node-id | MIGRATING node-id | NODE node-id | STABLE 〉 [ TIMEOUT timeout ] https://valkey.io/commands/cluster-setslot/

async functioncommandlog-get: async func( connection: borrow<connection>, count: integer, type: commandlog-type, ) -> result<list<commandlog-entry>, error-code>since 0.3.0-dev

Returns the specified command log's entries.

COMMANDLOG GET count 〈 slow | large-request | large-reply 〉 https://valkey.io/commands/commandlog-get/

async functioncommandlog-len: async func( connection: borrow<connection>, type: commandlog-type, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of entries in the specified type of command log.

COMMANDLOG LEN 〈 slow | large-request | large-reply 〉 https://valkey.io/commands/commandlog-len/

async functioncommandlog-reset: async func( connection: borrow<connection>, type: commandlog-type, ) -> result<_, error-code>since 0.3.0-dev

Clears all entries from the specified type of command log.

COMMANDLOG RESET 〈 slow | large-request | large-reply 〉 https://valkey.io/commands/commandlog-reset/

async functionconfig-get: async func( connection: borrow<connection>, parameters: list<string>, ) -> result<map<string, string>, error-code>since 0.3.0-dev

Returns the effective values of configuration parameters.

CONFIG GET parameter [ parameter ... ] https://valkey.io/commands/config-get/

async functionconfig-resetstat: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Resets the server's statistics.

CONFIG RESETSTAT https://valkey.io/commands/config-resetstat/

async functionconfig-rewrite: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Persists the effective configuration to file.

CONFIG REWRITE https://valkey.io/commands/config-rewrite/

async functionconfig-set: async func( connection: borrow<connection>, parameters-and-values: list<tuple<string, string>>, ) -> result<_, error-code>since 0.3.0-dev

Sets configuration parameters in-flight.

CONFIG SET parameter value [ parameter value ... ] https://valkey.io/commands/config-set/

async functionfailover: async func( connection: borrow<connection>, target: option<failover-target>, abort: bool, timeout: option<duration-milliseconds>, ) -> result<_, error-code>since 0.3.0-dev

Starts a coordinated failover from a server to one of its replicas.

FAILOVER [ TO host port [ FORCE ] ] [ ABORT ] [ TIMEOUT milliseconds ] https://valkey.io/commands/failover/

async functionlastsave: async func( connection: borrow<connection>, ) -> result<unix-time-seconds, error-code>since 0.3.0-dev

Returns the Unix timestamp of the last successful save to disk.

LASTSAVE https://valkey.io/commands/lastsave/

async functionlatency-doctor: async func( connection: borrow<connection>, ) -> result<string, error-code>since 0.3.0-dev

Returns a human-readable latency analysis report.

LATENCY DOCTOR https://valkey.io/commands/latency-doctor/

async functionlatency-graph: async func( connection: borrow<connection>, event: string, ) -> result<string, error-code>since 0.3.0-dev

Returns a latency graph for an event.

LATENCY GRAPH event https://valkey.io/commands/latency-graph/

async functionlatency-histogram: async func( connection: borrow<connection>, commands: option<list<string>>, ) -> result<map<string, latency-histogram-entry>, error-code>since 0.3.0-dev

Returns the cumulative distribution of latencies of a subset or all commands.

LATENCY HISTOGRAM [ command [ command ... ] ] https://valkey.io/commands/latency-histogram/

async functionlatency-history: async func( connection: borrow<connection>, event: string, ) -> result<list<tuple<unix-time-seconds, duration-milliseconds>>, error-code>since 0.3.0-dev

Returns timestamp-latency samples for an event.

LATENCY HISTORY event https://valkey.io/commands/latency-history/

async functionlatency-latest: async func( connection: borrow<connection>, ) -> result<list<latency-latest-entry>, error-code>since 0.3.0-dev

Returns the latest latency samples for all events.

LATENCY LATEST https://valkey.io/commands/latency-latest/

async functionlatency-reset: async func( connection: borrow<connection>, events: option<list<string>>, ) -> result<integer, error-code>since 0.3.0-dev

Resets the latency data for one or more events.

LATENCY RESET [ event [ event ... ] ] https://valkey.io/commands/latency-reset/

async functionmodule-list: async func( connection: borrow<connection>, ) -> result<list<module-list-entry>, error-code>since 0.3.0-dev

Returns all loaded modules.

MODULE LIST https://valkey.io/commands/module-list/

async functionmodule-load: async func( connection: borrow<connection>, path: string, args: option<list<string>>, ) -> result<_, error-code>since 0.3.0-dev

Loads a module.

MODULE LOAD path [ arg [ arg ... ] ] https://valkey.io/commands/module-load/

async functionmodule-loadex: async func( connection: borrow<connection>, path: string, configs: option<list<tuple<string, string>>>, args: option<list<string>>, ) -> result<_, error-code>since 0.3.0-dev

Loads a module using extended parameters.

MODULE LOADEX path [ CONFIG name value [ CONFIG name value ... ] ] [ ARGS args [ args ... ] ] https://valkey.io/commands/module-loadex/

async functionmodule-unload: async func( connection: borrow<connection>, name: string, ) -> result<_, error-code>since 0.3.0-dev

Unloads a module.

MODULE UNLOAD name https://valkey.io/commands/module-unload/

async functionreplicaof: async func( connection: borrow<connection>, primary: option<tuple<string, u16>>, ) -> result<string, error-code>since 0.3.0-dev

Configures a server as replica of another, or promotes it to a primary.

None makes the server a primary, NO ONE.

REPLICAOF 〈 host port | NO ONE 〉 https://valkey.io/commands/replicaof/

async functionrole: async func( connection: borrow<connection>, ) -> result<role-reply, error-code>since 0.3.0-dev

Returns the replication role.

ROLE https://valkey.io/commands/role/

async functionsave: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Synchronously saves the database(s) to disk.

SAVE https://valkey.io/commands/save/

async functionshutdown: async func( connection: borrow<connection>, save: option<shutdown-save>, modifiers: shutdown-flags, ) -> result<_, error-code>since 0.3.0-dev

Synchronously saves the database(s) to disk and shuts down the server.

The server closes the connection once it stops, so a shutdown that succeeds fails the call with a closed error.

See also shutdown-abort.

SHUTDOWN [ NOSAVE | SAVE ] [ NOW ] [ FORCE ] [ SAFE ] [ FAILOVER ] https://valkey.io/commands/shutdown/

async functionshutdown-abort: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Synchronously saves the database(s) to disk and shuts down the server.

The ABORT form, aborting a shutdown in progress.

See also shutdown.

SHUTDOWN ABORT https://valkey.io/commands/shutdown/

async functionslowlog-get: async func( connection: borrow<connection>, count: option<integer>, ) -> result<list<slowlog-entry>, error-code>since 0.3.0-dev

Returns the slow log's entries.

SLOWLOG GET [ count ] https://valkey.io/commands/slowlog-get/

async functionslowlog-len: async func( connection: borrow<connection>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of entries in the slow log.

SLOWLOG LEN https://valkey.io/commands/slowlog-len/

async functionslowlog-reset: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Clears all entries from the slow log.

SLOWLOG RESET https://valkey.io/commands/slowlog-reset/

async functionbitcount: async func( connection: borrow<connection>, key: string, range: option<bit-range>, ) -> result<integer, error-code>since 0.3.0-dev

Counts the number of set bits (population counting) in a string.

BITCOUNT key [ start [ end [ BYTE | BIT ] ] ] https://valkey.io/commands/bitcount/

async functionbitfield: async func( connection: borrow<connection>, key: string, operations: option<list<bitfield-operation>>, ) -> result<list<option<integer>>, error-code>since 0.3.0-dev

Performs arbitrary bitfield integer operations on strings.

None for a write that failed with OVERFLOW FAIL.

BITFIELD key [ GET encoding offset | [ OVERFLOW WRAP | SAT | FAIL ] 〈 SET encoding offset value | INCRBY encoding offset increment 〉 [ GET encoding offset | [ OVERFLOW WRAP | SAT | FAIL ] 〈 SET encoding offset value | INCRBY encoding offset increment 〉 ... ] ] https://valkey.io/commands/bitfield/

async functionbitfield-ro: async func( connection: borrow<connection>, key: string, gets: option<list<bitfield-ro-get>>, ) -> result<list<integer>, error-code>since 0.3.0-dev

Performs arbitrary read-only bitfield integer operations on strings.

BITFIELD_RO key [ GET encoding offset [ GET encoding offset ... ] ] https://valkey.io/commands/bitfield_ro/

async functionbitop: async func( connection: borrow<connection>, destination: string, operation: bitop-operation, ) -> result<integer, error-code>since 0.3.0-dev

Performs bitwise operations on multiple strings, and stores the result.

BITOP 〈 AND | OR | XOR | NOT 〉 destkey key [ key ... ] https://valkey.io/commands/bitop/

async functionbitpos: async func( connection: borrow<connection>, key: string, bit: bool, range: option<bit-range>, ) -> result<option<integer>, error-code>since 0.3.0-dev

Finds the first set (1) or clear (0) bit in a string.

None when no bit matches, the server's -1.

BITPOS key bit [ start [ end [ BYTE | BIT ] ] ] https://valkey.io/commands/bitpos/

async functiongetbit: async func( connection: borrow<connection>, key: string, offset: u64, ) -> result<bool, error-code>since 0.3.0-dev

Returns a bit value by offset.

GETBIT key offset https://valkey.io/commands/getbit/

async functionsetbit: async func( connection: borrow<connection>, key: string, offset: u64, value: bool, ) -> result<bool, error-code>since 0.3.0-dev

Sets or clears the bit at offset of the string value.

SETBIT key offset value https://valkey.io/commands/setbit/

async functionasking: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Signals that a cluster client is following an -ASK redirect.

It applies to the next command on the connection, which may be another caller's when the connection is shared. Use a connection of your own.

ASKING https://valkey.io/commands/asking/

async functionauth: async func( connection: borrow<connection>, username: option<string>, password: string, ) -> result<_, error-code>since 0.3.0-dev

Authenticates the connection.

AUTH [ username ] password https://valkey.io/commands/auth/

async functionclient-caching: async func( connection: borrow<connection>, enabled: bool, ) -> result<_, error-code>since 0.3.0-dev

Instructs the server whether to track the keys in the next request.

It applies to the next command on the connection, which may be another caller's when the connection is shared. Use a connection of your own.

CLIENT CACHING 〈 YES | NO 〉 https://valkey.io/commands/client-caching/

async functionclient-capa: async func( connection: borrow<connection>, capabilities: list<string>, ) -> result<_, error-code>since 0.3.0-dev

A client claims its capability.

CLIENT CAPA capability [ capability ... ] https://valkey.io/commands/client-capa/

async functionclient-getname: async func( connection: borrow<connection>, ) -> result<option<string>, error-code>since 0.3.0-dev

Returns the name of the connection.

CLIENT GETNAME https://valkey.io/commands/client-getname/

async functionclient-id: async func( connection: borrow<connection>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the unique client ID of the connection.

CLIENT ID https://valkey.io/commands/client-id/

async functionclient-import-source: async func( connection: borrow<connection>, enabled: bool, ) -> result<_, error-code>since 0.3.0-dev

Marks this client as an import source when the server is in import mode.

CLIENT IMPORT-SOURCE 〈 ON | OFF 〉 https://valkey.io/commands/client-import-source/

async functionclient-info: async func( connection: borrow<connection>, ) -> result<map<string, string>, error-code>since 0.3.0-dev

Returns information about the connection.

A map of the fields, parsed from the server's text, e.g. id, addr and name.

CLIENT INFO https://valkey.io/commands/client-info/

async functionclient-no-touch: async func( connection: borrow<connection>, enabled: bool, ) -> result<_, error-code>since 0.3.0-dev

Controls whether commands sent by the client affect the LRU/LFU of accessed keys.

It applies to the connection, so to every caller sharing it.

CLIENT NO-TOUCH 〈 ON | OFF 〉 https://valkey.io/commands/client-no-touch/

async functionclient-setinfo: async func( connection: borrow<connection>, attr: client-setinfo-attr, ) -> result<_, error-code>since 0.3.0-dev

Sets information specific to the client or connection.

CLIENT SETINFO 〈 LIB-NAME libname | LIB-VER libver 〉 https://valkey.io/commands/client-setinfo/

async functionclient-setname: async func( connection: borrow<connection>, connection-name: string, ) -> result<_, error-code>since 0.3.0-dev

Sets the connection name.

CLIENT SETNAME connection-name https://valkey.io/commands/client-setname/

async functionclient-tracking: async func( connection: borrow<connection>, options: option<client-tracking-options>, ) -> result<_, error-code>since 0.3.0-dev

Controls server-assisted client-side caching for the connection.

Invalidations arrive as push messages, see connection.dead-letters. It applies to the connection, so to every caller sharing it.

CLIENT TRACKING 〈 ON | OFF 〉 [ PREFIX prefix [ PREFIX prefix ... ] ] [ BCAST ] [ OPTIN ] [ OPTOUT ] [ NOLOOP ] https://valkey.io/commands/client-tracking/

async functionclient-trackinginfo: async func( connection: borrow<connection>, ) -> result<client-trackinginfo-reply, error-code>since 0.3.0-dev

Returns information about server-assisted client-side caching for the connection.

CLIENT TRACKINGINFO https://valkey.io/commands/client-trackinginfo/

async functioncommand: async func( connection: borrow<connection>, ) -> result<list<command-reply>, error-code>since 0.3.0-dev

Returns detailed information about all commands.

COMMAND https://valkey.io/commands/command/

async functioncommand-count: async func( connection: borrow<connection>, ) -> result<integer, error-code>since 0.3.0-dev

Returns a count of commands.

COMMAND COUNT https://valkey.io/commands/command-count/

async functioncommand-docs: async func( connection: borrow<connection>, command-names: option<list<string>>, ) -> result<list<command-docs-reply>, error-code>since 0.3.0-dev

Returns documentary information about one, multiple or all commands.

A container is followed by its subcommands. Commands that do not exist are left out.

COMMAND DOCS [ command-name [ command-name ... ] ] https://valkey.io/commands/command-docs/

async functioncommand-getkeys: async func( connection: borrow<connection>, command: list<string>, ) -> result<list<string>, error-code>since 0.3.0-dev

Extracts the key names from an arbitrary command.

COMMAND GETKEYS command [ arg [ arg ... ] ] https://valkey.io/commands/command-getkeys/

async functioncommand-getkeysandflags: async func( connection: borrow<connection>, command: list<string>, ) -> result<list<tuple<string, list<string>>>, error-code>since 0.3.0-dev

Extracts the key names and access flags for an arbitrary command.

COMMAND GETKEYSANDFLAGS command [ arg [ arg ... ] ] https://valkey.io/commands/command-getkeysandflags/

async functioncommand-info: async func( connection: borrow<connection>, command-names: option<list<string>>, ) -> result<list<command-info-reply>, error-code>since 0.3.0-dev

Returns information about one, multiple or all commands.

A container is followed by its subcommands. Commands that do not exist are left out.

COMMAND INFO [ command-name [ command-name ... ] ] https://valkey.io/commands/command-info/

async functioncommand-list: async func( connection: borrow<connection>, filter: option<command-list-filter>, ) -> result<list<string>, error-code>since 0.3.0-dev

Returns a list of command names.

COMMAND LIST [ FILTERBY 〈 MODULE module-name | ACLCAT category | PATTERN pattern 〉 ] https://valkey.io/commands/command-list/

async functionecho: async func( connection: borrow<connection>, message: string-or-bytes, ) -> result<string-or-bytes, error-code>since 0.3.0-dev

Returns the given string.

ECHO message https://valkey.io/commands/echo/

async functionping: async func( connection: borrow<connection>, message: option<string-or-bytes>, ) -> result<_, error-code>since 0.3.0-dev

Returns the server's liveliness response.

PING [ message ] https://valkey.io/commands/ping/

async functionreadonly: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Enables read-only queries for a connection to a Valkey replica node.

It applies to the connection, so to every caller sharing it.

READONLY https://valkey.io/commands/readonly/

async functionreadwrite: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Enables read-write queries for a connection to a Valkey replica node.

It applies to the connection, so to every caller sharing it.

READWRITE https://valkey.io/commands/readwrite/

async functionselect: async func( connection: borrow<connection>, index: integer, ) -> result<_, error-code>since 0.3.0-dev

Changes the selected database.

It applies to the connection, so to every caller sharing it.

SELECT index https://valkey.io/commands/select/

async functionwait: async func( connection: borrow<connection>, numreplicas: integer, timeout: duration-milliseconds, ) -> result<integer, error-code>since 0.3.0-dev

Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.

The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

WAIT numreplicas timeout https://valkey.io/commands/wait/

async functionwaitaof: async func( connection: borrow<connection>, numlocal: integer, numreplicas: integer, timeout: duration-milliseconds, ) -> result<tuple<integer, integer>, error-code>since 0.3.0-dev

Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the primary and/or replicas.

The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

WAITAOF numlocal numreplicas timeout https://valkey.io/commands/waitaof/

async functiongeoadd: async func( connection: borrow<connection>, key: string, condition: option<geoadd-condition>, changed: bool, coordinates-and-members: list<tuple<geo-coordinates, string-or-bytes>>, ) -> result<integer, error-code>since 0.3.0-dev

Adds one or more members to a geospatial index.

GEOADD key [ NX | XX ] [ CH ] longitude latitude member [ longitude latitude member ... ] https://valkey.io/commands/geoadd/

async functiongeodist: async func( connection: borrow<connection>, key: string, member1: string-or-bytes, member2: string-or-bytes, unit: option<geo-unit>, ) -> result<option<double>, error-code>since 0.3.0-dev

Returns the distance between two members of a geospatial index.

GEODIST key member1 member2 [ m | km | ft | mi ] https://valkey.io/commands/geodist/

async functiongeohash: async func( connection: borrow<connection>, key: string, members: option<list<string-or-bytes>>, ) -> result<list<option<string>>, error-code>since 0.3.0-dev

Returns members from a geospatial index as geohash strings.

GEOHASH key [ member [ member ... ] ] https://valkey.io/commands/geohash/

async functiongeopos: async func( connection: borrow<connection>, key: string, members: option<list<string-or-bytes>>, ) -> result<list<option<geo-coordinates>>, error-code>since 0.3.0-dev

Returns the longitude and latitude of members from a geospatial index.

GEOPOS key [ member [ member ... ] ] https://valkey.io/commands/geopos/

async functiongeosearch: async func( connection: borrow<connection>, key: string, shape: geosearch-shape, order: option<sort-order>, count: option<geosearch-count>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Queries a geospatial index for members inside an area of a box, circle, or a polygon.

See also geosearch-with.

GEOSEARCH key [ FROMMEMBER member | FROMLONLAT longitude latitude ] 〈 BYRADIUS radius 〈 m | km | ft | mi 〉 | BYBOX width height 〈 m | km | ft | mi 〉 | BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ] 〉 [ ASC | DESC ] [ COUNT count [ ANY ] ] https://valkey.io/commands/geosearch/

async functiongeosearch-with: async func( connection: borrow<connection>, key: string, shape: geosearch-shape, order: option<sort-order>, count: option<geosearch-count>, details: geosearch-with-flags, ) -> result<list<geosearch-with-result>, error-code>since 0.3.0-dev

Queries a geospatial index for members inside an area of a box, circle, or a polygon.

Returns each member with the details asked for, WITHCOORD, WITHDIST and WITHHASH.

See also geosearch.

GEOSEARCH key [ FROMMEMBER member | FROMLONLAT longitude latitude ] 〈 BYRADIUS radius 〈 m | km | ft | mi 〉 | BYBOX width height 〈 m | km | ft | mi 〉 | BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ] 〉 [ ASC | DESC ] [ COUNT count [ ANY ] ] [ WITHCOORD ] [ WITHDIST ] [ WITHHASH ] https://valkey.io/commands/geosearch/

async functiongeosearchstore: async func( connection: borrow<connection>, destination: string, source: string, shape: geosearchstore-shape, order: option<sort-order>, count: option<geosearchstore-count>, storedist: bool, ) -> result<integer, error-code>since 0.3.0-dev

Queries a geospatial index for members inside an area of a box, a circle, or a polygon, optionally stores the result.

GEOSEARCHSTORE destination source [ FROMMEMBER member | FROMLONLAT longitude latitude ] 〈 BYRADIUS radius 〈 m | km | ft | mi 〉 | BYBOX width height 〈 m | km | ft | mi 〉 | BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ] 〉 [ ASC | DESC ] [ COUNT count [ ANY ] ] [ STOREDIST ] https://valkey.io/commands/geosearchstore/

async functionhdel: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Deletes one or more fields and their values from a hash.

HDEL key field [ field ... ] https://valkey.io/commands/hdel/

async functionhexists: async func( connection: borrow<connection>, key: string, field: string, ) -> result<bool, error-code>since 0.3.0-dev

Determines whether a field exists in a hash.

HEXISTS key field https://valkey.io/commands/hexists/

async functionhexpire: async func( connection: borrow<connection>, key: string, seconds: duration-seconds, mode: option<ttl-mode>, fields: list<string>, ) -> result<list<hexpire-result>, error-code>since 0.3.0-dev

Sets the expiration time of one or more hash fields in seconds.

HEXPIRE key seconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ] https://valkey.io/commands/hexpire/

async functionhexpireat: async func( connection: borrow<connection>, key: string, seconds: unix-time-seconds, mode: option<ttl-mode>, fields: list<string>, ) -> result<list<hexpireat-result>, error-code>since 0.3.0-dev

Sets the expiration time of one or more hash fields to a Unix timestamp.

HEXPIREAT key unix-time-seconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ] https://valkey.io/commands/hexpireat/

async functionhexpiretime: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<hexpiretime-reply>, error-code>since 0.3.0-dev

Returns Unix timestamps in seconds since the epoch at which the given key's field(s) will expire.

HEXPIRETIME key FIELDS numfields field [ field ... ] https://valkey.io/commands/hexpiretime/

async functionhget: async func( connection: borrow<connection>, key: string, field: string, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns the value of a field in a hash.

HGET key field https://valkey.io/commands/hget/

async functionhgetall: async func( connection: borrow<connection>, key: string, ) -> result<map<string, string-or-bytes>, error-code>since 0.3.0-dev

Returns all fields and values in a hash.

HGETALL key https://valkey.io/commands/hgetall/

async functionhgetdel: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<option<string-or-bytes>>, error-code>since 0.3.0-dev

Returns the values of one or more fields and deletes them from a hash.

HGETDEL key FIELDS numfields field [ field ... ] https://valkey.io/commands/hgetdel/

async functionhgetex: async func( connection: borrow<connection>, key: string, ttl: option<hgetex-ttl>, fields: list<string>, ) -> result<list<option<string-or-bytes>>, error-code>since 0.3.0-dev

Gets the value of one or more fields of a given hash key, and optionally sets their expiration time or time-to-live (TTL).

HGETEX key [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST ] FIELDS numfields field [ field ... ] https://valkey.io/commands/hgetex/

async functionhincrby: async func( connection: borrow<connection>, key: string, field: string, increment: integer, ) -> result<integer, error-code>since 0.3.0-dev

Increments the integer value of a field in a hash by a number.

HINCRBY key field increment https://valkey.io/commands/hincrby/

async functionhincrbyfloat: async func( connection: borrow<connection>, key: string, field: string, increment: double, ) -> result<double, error-code>since 0.3.0-dev

Increments the floating point value of a field by a number.

HINCRBYFLOAT key field increment https://valkey.io/commands/hincrbyfloat/

async functionhkeys: async func( connection: borrow<connection>, key: string, ) -> result<list<string>, error-code>since 0.3.0-dev

Returns all fields in a hash.

HKEYS key https://valkey.io/commands/hkeys/

async functionhlen: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of fields in a hash.

HLEN key https://valkey.io/commands/hlen/

async functionhmget: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<option<string-or-bytes>>, error-code>since 0.3.0-dev

Returns the values of all fields in a hash.

HMGET key field [ field ... ] https://valkey.io/commands/hmget/

async functionhmset: async func( connection: borrow<connection>, key: string, field-and-values: list<tuple<string, string-or-bytes>>, ) -> result<_, error-code>since 0.3.0-dev

Sets the values of multiple fields.

HMSET key field value [ field value ... ] https://valkey.io/commands/hmset/

async functionhpersist: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<hpersist-result>, error-code>since 0.3.0-dev

Remove the existing expiration on a hash key's field(s).

HPERSIST key FIELDS numfields field [ field ... ] https://valkey.io/commands/hpersist/

async functionhpexpire: async func( connection: borrow<connection>, key: string, milliseconds: duration-milliseconds, mode: option<ttl-mode>, fields: list<string>, ) -> result<list<hpexpire-result>, error-code>since 0.3.0-dev

Sets the expiration time of one or more hash fields in milliseconds.

HPEXPIRE key milliseconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ] https://valkey.io/commands/hpexpire/

async functionhpexpireat: async func( connection: borrow<connection>, key: string, milliseconds: unix-time-milliseconds, mode: option<ttl-mode>, fields: list<string>, ) -> result<list<hpexpireat-result>, error-code>since 0.3.0-dev

Sets the expiration time of one or more hash fields to a Unix timestamp in milliseconds.

HPEXPIREAT key unix-time-milliseconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ] https://valkey.io/commands/hpexpireat/

async functionhpexpiretime: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<hpexpiretime-reply>, error-code>since 0.3.0-dev

Returns the Unix timestamp in milliseconds since Unix epoch at which the given key's field(s) will expire.

HPEXPIRETIME key FIELDS numfields field [ field ... ] https://valkey.io/commands/hpexpiretime/

async functionhpttl: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<hpttl-reply>, error-code>since 0.3.0-dev

Returns the remaining time to live in milliseconds of a hash key's field(s) that have an associated expiration.

HPTTL key FIELDS numfields field [ field ... ] https://valkey.io/commands/hpttl/

async functionhrandfield: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<string>, error-code>since 0.3.0-dev

Returns one or more random fields from a hash.

Without a count, at most one field.

See also hrandfield-withvalues.

HRANDFIELD key [ count ] https://valkey.io/commands/hrandfield/

async functionhrandfield-withvalues: async func( connection: borrow<connection>, key: string, count: integer, ) -> result<list<tuple<string, string-or-bytes>>, error-code>since 0.3.0-dev

Returns one or more random fields from a hash.

The WITHVALUES form, the fields and their values.

See also hrandfield.

HRANDFIELD key count WITHVALUES https://valkey.io/commands/hrandfield/

async functionhscan: async func( connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>, ) -> result<tuple<option<cursor>, map<string, string-or-bytes>>, error-code>since 0.3.0-dev

Iterates over fields and values of a hash.

See also hscan-novalues.

HSCAN key cursor [ MATCH pattern ] [ COUNT count ] https://valkey.io/commands/hscan/

async functionhscan-novalues: async func( connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>, ) -> result<tuple<option<cursor>, list<string>>, error-code>since 0.3.0-dev

Iterates over fields and values of a hash.

The NOVALUES form, the fields only.

See also hscan.

HSCAN key cursor [ MATCH pattern ] [ COUNT count ] NOVALUES https://valkey.io/commands/hscan/

async functionhset: async func( connection: borrow<connection>, key: string, field-and-values: list<tuple<string, string-or-bytes>>, ) -> result<integer, error-code>since 0.3.0-dev

Creates or modifies the value of a field in a hash.

HSET key field value [ field value ... ] https://valkey.io/commands/hset/

async functionhsetex: async func( connection: borrow<connection>, key: string, condition: option<hsetex-condition>, field-condition: option<hsetex-field-condition>, ttl: option<hsetex-ttl>, field-and-values: list<tuple<string, string-or-bytes>>, ) -> result<bool, error-code>since 0.3.0-dev

Sets the value of one or more fields of a given hash key, and optionally sets their expiration time.

HSETEX key [ NX | XX ] [ FNX | FXX ] [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ] FIELDS numfields field value [ field value ... ] https://valkey.io/commands/hsetex/

async functionhsetnx: async func( connection: borrow<connection>, key: string, field: string, value: string-or-bytes, ) -> result<bool, error-code>since 0.3.0-dev

Sets the value of a field in a hash only when the field doesn't exist.

HSETNX key field value https://valkey.io/commands/hsetnx/

async functionhstrlen: async func( connection: borrow<connection>, key: string, field: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the length of the value of a field.

HSTRLEN key field https://valkey.io/commands/hstrlen/

async functionhttl: async func( connection: borrow<connection>, key: string, fields: list<string>, ) -> result<list<httl-reply>, error-code>since 0.3.0-dev

Returns the remaining time to live (in seconds) of a hash key's field(s) that have an associated expiration.

HTTL key FIELDS numfields field [ field ... ] https://valkey.io/commands/httl/

async functionhvals: async func( connection: borrow<connection>, key: string, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns all values in a hash.

HVALS key https://valkey.io/commands/hvals/

async functionpfadd: async func( connection: borrow<connection>, key: string, elements: option<list<string-or-bytes>>, ) -> result<bool, error-code>since 0.3.0-dev

Adds elements to a HyperLogLog key.

PFADD key [ element [ element ... ] ] https://valkey.io/commands/pfadd/

async functionpfcount: async func( connection: borrow<connection>, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s).

PFCOUNT key [ key ... ] https://valkey.io/commands/pfcount/

async functionpfmerge: async func( connection: borrow<connection>, destination: string, sources: option<list<string>>, ) -> result<_, error-code>since 0.3.0-dev

Merges one or more HyperLogLog values into a single key.

PFMERGE destkey [ sourcekey [ sourcekey ... ] ] https://valkey.io/commands/pfmerge/

async functioncluster-flushslot: async func( connection: borrow<connection>, slot: u16, mode: option<flush-mode>, ) -> result<_, error-code>since 0.3.0-dev

Removes all keys from the target slot.

CLUSTER FLUSHSLOT slot [ ASYNC | SYNC ] https://valkey.io/commands/cluster-flushslot/

async functionclusterscan: async func( connection: borrow<connection>, cursor: cursor, match: option<string>, count: option<integer>, type: option<key-type>, slot: option<u16>, ) -> result<tuple<option<cursor>, list<string>>, error-code>since 0.3.0-dev

Iterates over the keys in the cluster.

The cursor carries the slot, for clients to route each call to the node that owns it.

CLUSTERSCAN cursor [ MATCH match-pattern ] [ COUNT count ] [ TYPE type ] [ SLOT slot ] https://valkey.io/commands/clusterscan/

async functioncopy: async func( connection: borrow<connection>, source: string, destination: string, destination-db: option<integer>, replace: bool, ) -> result<bool, error-code>since 0.3.0-dev

Copies the value of a key to a new key.

COPY source destination [ DB destination-db ] [ REPLACE ] https://valkey.io/commands/copy/

async functiondbsize: async func( connection: borrow<connection>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of keys in the database.

DBSIZE https://valkey.io/commands/dbsize/

async functiondel: async func( connection: borrow<connection>, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Deletes one or more keys.

DEL key [ key ... ] https://valkey.io/commands/del/

async functiondump: async func( connection: borrow<connection>, key: string, ) -> result<option<bytes>, error-code>since 0.3.0-dev

Returns a serialized representation of the value stored at a key.

DUMP key https://valkey.io/commands/dump/

async functionexists: async func( connection: borrow<connection>, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Determines whether one or more keys exist.

EXISTS key [ key ... ] https://valkey.io/commands/exists/

async functionexpire: async func( connection: borrow<connection>, key: string, seconds: duration-seconds, mode: option<ttl-mode>, ) -> result<bool, error-code>since 0.3.0-dev

Sets the expiration time of a key in seconds.

EXPIRE key seconds [ NX | XX | GT | LT ] https://valkey.io/commands/expire/

async functionexpireat: async func( connection: borrow<connection>, key: string, seconds: unix-time-seconds, mode: option<ttl-mode>, ) -> result<bool, error-code>since 0.3.0-dev

Sets the expiration time of a key to a Unix timestamp.

EXPIREAT key unix-time-seconds [ NX | XX | GT | LT ] https://valkey.io/commands/expireat/

async functionexpiretime: async func( connection: borrow<connection>, key: string, ) -> result<expiretime-reply, error-code>since 0.3.0-dev

Returns the expiration time of a key as a Unix timestamp.

EXPIRETIME key https://valkey.io/commands/expiretime/

async functionflushall: async func( connection: borrow<connection>, mode: option<flush-mode>, ) -> result<_, error-code>since 0.3.0-dev

Removes all keys from all databases.

FLUSHALL [ ASYNC | SYNC ] https://valkey.io/commands/flushall/

async functionflushdb: async func( connection: borrow<connection>, mode: option<flush-mode>, ) -> result<_, error-code>since 0.3.0-dev

Removes all keys from the current database.

FLUSHDB [ ASYNC | SYNC ] https://valkey.io/commands/flushdb/

async functionkeys: async func( connection: borrow<connection>, pattern: string, ) -> result<list<string>, error-code>since 0.3.0-dev

Returns all key names that match a pattern.

KEYS pattern https://valkey.io/commands/keys/

async functionmigrate: async func( connection: borrow<connection>, host: string, port: u16, destination-db: integer, timeout: duration-milliseconds, options: migrate-flags, auth: option<migrate-auth>, keys: list<string>, ) -> result<bool, error-code>since 0.3.0-dev

Atomically transfers a key from one instance to another.

False when none of the keys exist, the server's NOKEY.

MIGRATE host port "" destination-db timeout [ COPY ] [ REPLACE ] [ AUTH password | AUTH2 username password ] KEYS key [ key ... ] https://valkey.io/commands/migrate/

async functionmove: async func( connection: borrow<connection>, key: string, db: integer, replace: bool, ) -> result<bool, error-code>since 0.3.0-dev

Moves a key to another database.

MOVE key db [ REPLACE ] https://valkey.io/commands/move/

async functionobject-encoding: async func( connection: borrow<connection>, key: string, ) -> result<option<string>, error-code>since 0.3.0-dev

Returns the internal encoding of an object.

OBJECT ENCODING key https://valkey.io/commands/object-encoding/

async functionobject-freq: async func( connection: borrow<connection>, key: string, ) -> result<option<integer>, error-code>since 0.3.0-dev

Returns the logarithmic access frequency counter of an object.

OBJECT FREQ key https://valkey.io/commands/object-freq/

async functionobject-idletime: async func( connection: borrow<connection>, key: string, ) -> result<option<duration-seconds>, error-code>since 0.3.0-dev

Returns the time since the last access to an object.

OBJECT IDLETIME key https://valkey.io/commands/object-idletime/

async functionobject-refcount: async func( connection: borrow<connection>, key: string, ) -> result<option<integer>, error-code>since 0.3.0-dev

Returns the reference count of a value of a key.

OBJECT REFCOUNT key https://valkey.io/commands/object-refcount/

async functionpersist: async func( connection: borrow<connection>, key: string, ) -> result<bool, error-code>since 0.3.0-dev

Removes the expiration time of a key.

PERSIST key https://valkey.io/commands/persist/

async functionpexpire: async func( connection: borrow<connection>, key: string, milliseconds: duration-milliseconds, mode: option<ttl-mode>, ) -> result<bool, error-code>since 0.3.0-dev

Sets the expiration time of a key in milliseconds.

PEXPIRE key milliseconds [ NX | XX | GT | LT ] https://valkey.io/commands/pexpire/

async functionpexpireat: async func( connection: borrow<connection>, key: string, milliseconds: unix-time-milliseconds, mode: option<ttl-mode>, ) -> result<bool, error-code>since 0.3.0-dev

Sets the expiration time of a key to a Unix milliseconds timestamp.

PEXPIREAT key unix-time-milliseconds [ NX | XX | GT | LT ] https://valkey.io/commands/pexpireat/

async functionpexpiretime: async func( connection: borrow<connection>, key: string, ) -> result<pexpiretime-reply, error-code>since 0.3.0-dev

Returns the expiration time of a key as a Unix milliseconds timestamp.

PEXPIRETIME key https://valkey.io/commands/pexpiretime/

async functionpttl: async func( connection: borrow<connection>, key: string, ) -> result<pttl-reply, error-code>since 0.3.0-dev

Returns the expiration time in milliseconds of a key.

PTTL key https://valkey.io/commands/pttl/

async functionrandomkey: async func( connection: borrow<connection>, ) -> result<option<string>, error-code>since 0.3.0-dev

Returns a random key name from the database.

RANDOMKEY https://valkey.io/commands/randomkey/

async functionrename: async func( connection: borrow<connection>, key: string, newkey: string, ) -> result<_, error-code>since 0.3.0-dev

Renames a key and overwrites the destination.

RENAME key newkey https://valkey.io/commands/rename/

async functionrenamenx: async func( connection: borrow<connection>, key: string, newkey: string, ) -> result<bool, error-code>since 0.3.0-dev

Renames a key only when the target key name doesn't exist.

RENAMENX key newkey https://valkey.io/commands/renamenx/

async functionrestore: async func( connection: borrow<connection>, key: string, ttl: option<restore-ttl>, serialized-value: bytes, replace: bool, idletime: option<duration-seconds>, freq: option<integer>, ) -> result<_, error-code>since 0.3.0-dev

Creates a key from the serialized representation of a value.

A ttl of none restores the key without an expiration, 0, expire-at adds ABSTTL.

RESTORE key ttl serialized-value [ REPLACE ] [ ABSTTL ] [ IDLETIME seconds ] [ FREQ frequency ] https://valkey.io/commands/restore/

async functionrestore-asking: async func( connection: borrow<connection>, key: string, ttl: option<restore-ttl>, serialized-value: bytes, replace: bool, idletime: option<duration-seconds>, freq: option<integer>, ) -> result<_, error-code>since 0.3.0-dev

An internal command for migrating keys in a cluster.

A ttl of none restores the key without an expiration, 0, expire-at adds ABSTTL.

RESTORE-ASKING key ttl serialized-value [ REPLACE ] [ ABSTTL ] [ IDLETIME seconds ] [ FREQ frequency ] https://valkey.io/commands/restore-asking/

async functionscan: async func( connection: borrow<connection>, cursor: cursor, match: option<string>, count: option<integer>, type: option<key-type>, ) -> result<tuple<option<cursor>, list<string>>, error-code>since 0.3.0-dev

Iterates over the key names in the database.

SCAN cursor [ MATCH pattern ] [ COUNT count ] [ TYPE type ] https://valkey.io/commands/scan/

async functionswapdb: async func( connection: borrow<connection>, index1: integer, index2: integer, ) -> result<_, error-code>since 0.3.0-dev

Swaps two databases.

SWAPDB index1 index2 https://valkey.io/commands/swapdb/

async functiontouch: async func( connection: borrow<connection>, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of existing keys out of those specified after updating the time they were last accessed.

TOUCH key [ key ... ] https://valkey.io/commands/touch/

async functionttl: async func( connection: borrow<connection>, key: string, ) -> result<ttl-reply, error-code>since 0.3.0-dev

Returns the expiration time in seconds of a key.

TTL key https://valkey.io/commands/ttl/

async functiontype: async func( connection: borrow<connection>, key: string, ) -> result<option<key-type>, error-code>since 0.3.0-dev

Determines the type of value stored at a key.

None when the key does not exist, the server's none.

TYPE key https://valkey.io/commands/type/

async functionblmove: async func( connection: borrow<connection>, source: string, destination: string, wherefrom: list-side, whereto: list-side, timeout: duration-milliseconds, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Pops an element from a list, pushes it to another list and returns it.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BLMOVE source destination 〈 LEFT | RIGHT 〉 〈 LEFT | RIGHT 〉 timeout https://valkey.io/commands/blmove/

async functionblmpop: async func( connection: borrow<connection>, timeout: duration-milliseconds, keys: list<string>, end: list-side, count: option<integer>, ) -> result<option<tuple<string, list<string-or-bytes>>>, error-code>since 0.3.0-dev

Pops the first element from one of multiple lists.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BLMPOP timeout numkeys key [ key ... ] 〈 LEFT | RIGHT 〉 [ COUNT count ] https://valkey.io/commands/blmpop/

async functionblpop: async func( connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds, ) -> result<option<tuple<string, string-or-bytes>>, error-code>since 0.3.0-dev

Removes and returns the first element in a list.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BLPOP key [ key ... ] timeout https://valkey.io/commands/blpop/

async functionbrpop: async func( connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds, ) -> result<option<tuple<string, string-or-bytes>>, error-code>since 0.3.0-dev

Removes and returns the last element in a list.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BRPOP key [ key ... ] timeout https://valkey.io/commands/brpop/

async functionbrpoplpush: async func( connection: borrow<connection>, source: string, destination: string, timeout: duration-milliseconds, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Pops an element from a list, pushes it to another list and returns it.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BRPOPLPUSH source destination timeout https://valkey.io/commands/brpoplpush/

async functionlindex: async func( connection: borrow<connection>, key: string, index: integer, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns an element from a list by its index.

LINDEX key index https://valkey.io/commands/lindex/

async functionlinsert: async func( connection: borrow<connection>, key: string, position: linsert-position, pivot: string-or-bytes, element: string-or-bytes, ) -> result<linsert-result, error-code>since 0.3.0-dev

Inserts an element before or after another element in a list.

LINSERT key 〈 BEFORE | AFTER 〉 pivot element https://valkey.io/commands/linsert/

async functionllen: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the length of a list.

LLEN key https://valkey.io/commands/llen/

async functionlmove: async func( connection: borrow<connection>, source: string, destination: string, wherefrom: list-side, whereto: list-side, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns an element after popping it from one list and pushing it to another.

LMOVE source destination 〈 LEFT | RIGHT 〉 〈 LEFT | RIGHT 〉 https://valkey.io/commands/lmove/

async functionlmpop: async func( connection: borrow<connection>, keys: list<string>, end: list-side, count: option<integer>, ) -> result<option<tuple<string, list<string-or-bytes>>>, error-code>since 0.3.0-dev

Returns multiple elements from a list after removing them.

LMPOP numkeys key [ key ... ] 〈 LEFT | RIGHT 〉 [ COUNT count ] https://valkey.io/commands/lmpop/

async functionlpop: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns and removes one or more elements from the beginning of a list.

Without a count, at most one element.

LPOP key [ count ] https://valkey.io/commands/lpop/

async functionlpos: async func( connection: borrow<connection>, key: string, element: string-or-bytes, rank: option<integer>, count: option<integer>, maxlen: option<integer>, ) -> result<list<integer>, error-code>since 0.3.0-dev

Returns the index of matching elements in a list.

Without a count, at most one position.

LPOS key element [ RANK rank ] [ COUNT num-matches ] [ MAXLEN len ] https://valkey.io/commands/lpos/

async functionlpush: async func( connection: borrow<connection>, key: string, elements: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Prepends one or more elements to a list.

LPUSH key element [ element ... ] https://valkey.io/commands/lpush/

async functionlpushx: async func( connection: borrow<connection>, key: string, elements: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Prepends one or more elements to a list only when the list exists.

LPUSHX key element [ element ... ] https://valkey.io/commands/lpushx/

async functionlrange: async func( connection: borrow<connection>, key: string, start: integer, stop: integer, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns a range of elements from a list.

LRANGE key start stop https://valkey.io/commands/lrange/

async functionlrem: async func( connection: borrow<connection>, key: string, count: integer, element: string-or-bytes, ) -> result<integer, error-code>since 0.3.0-dev

Removes elements from a list.

LREM key count element https://valkey.io/commands/lrem/

async functionlset: async func( connection: borrow<connection>, key: string, index: integer, element: string-or-bytes, ) -> result<_, error-code>since 0.3.0-dev

Sets the value of an element in a list by its index.

LSET key index element https://valkey.io/commands/lset/

async functionltrim: async func( connection: borrow<connection>, key: string, start: integer, stop: integer, ) -> result<_, error-code>since 0.3.0-dev

Removes elements from both ends of a list.

LTRIM key start stop https://valkey.io/commands/ltrim/

async functionrpop: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns and removes one or more elements from the end of a list.

Without a count, at most one element.

RPOP key [ count ] https://valkey.io/commands/rpop/

async functionrpoplpush: async func( connection: borrow<connection>, source: string, destination: string, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns the last element of a list after removing and pushing it to another list.

RPOPLPUSH source destination https://valkey.io/commands/rpoplpush/

async functionrpush: async func( connection: borrow<connection>, key: string, elements: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Appends one or more elements to a list.

RPUSH key element [ element ... ] https://valkey.io/commands/rpush/

async functionrpushx: async func( connection: borrow<connection>, key: string, elements: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Appends one or more elements to a list only when the list exists.

RPUSHX key element [ element ... ] https://valkey.io/commands/rpushx/

async functionpublish: async func( connection: borrow<connection>, channel: string, message: string-or-bytes, ) -> result<integer, error-code>since 0.3.0-dev

Posts a message to a channel.

PUBLISH channel message https://valkey.io/commands/publish/

async functionpubsub-channels: async func( connection: borrow<connection>, pattern: option<string>, ) -> result<list<string>, error-code>since 0.3.0-dev

Returns the active channels.

PUBSUB CHANNELS [ pattern ] https://valkey.io/commands/pubsub-channels/

async functionpubsub-numpat: async func( connection: borrow<connection>, ) -> result<integer, error-code>since 0.3.0-dev

Returns a count of unique pattern subscriptions.

PUBSUB NUMPAT https://valkey.io/commands/pubsub-numpat/

async functionpubsub-numsub: async func( connection: borrow<connection>, channels: option<list<string>>, ) -> result<map<string, integer>, error-code>since 0.3.0-dev

Returns a count of subscribers to channels.

PUBSUB NUMSUB [ channel ] [ [ channel ] ... ] https://valkey.io/commands/pubsub-numsub/

async functionpubsub-shardchannels: async func( connection: borrow<connection>, pattern: option<string>, ) -> result<list<string>, error-code>since 0.3.0-dev

Returns the active shard channels.

PUBSUB SHARDCHANNELS [ pattern ] https://valkey.io/commands/pubsub-shardchannels/

async functionpubsub-shardnumsub: async func( connection: borrow<connection>, shardchannels: option<list<string>>, ) -> result<map<string, integer>, error-code>since 0.3.0-dev

Returns the count of subscribers of shard channels.

PUBSUB SHARDNUMSUB [ shardchannel [ shardchannel ... ] ] https://valkey.io/commands/pubsub-shardnumsub/

async functionspublish: async func( connection: borrow<connection>, shardchannel: string, message: string-or-bytes, ) -> result<integer, error-code>since 0.3.0-dev

Posts a message to a shard channel.

SPUBLISH shardchannel message https://valkey.io/commands/spublish/

async functioneval: async func( connection: borrow<connection>, script: string, keys: option<list<string>>, args: option<list<string-or-bytes>>, ) -> result<resp-value, error-code>since 0.3.0-dev

Executes a server-side Lua script.

An error the script returns fails the call.

EVAL script numkeys [ key [ key ... ] ] [ arg [ arg ... ] ] https://valkey.io/commands/eval/

async functioneval-ro: async func( connection: borrow<connection>, script: string, keys: option<list<string>>, args: option<list<string-or-bytes>>, ) -> result<resp-value, error-code>since 0.3.0-dev

Executes a read-only server-side Lua script.

An error the script returns fails the call.

EVAL_RO script numkeys [ key [ key ... ] ] [ arg [ arg ... ] ] https://valkey.io/commands/eval_ro/

async functionevalsha: async func( connection: borrow<connection>, sha1: string, keys: option<list<string>>, args: option<list<string-or-bytes>>, ) -> result<resp-value, error-code>since 0.3.0-dev

Executes a server-side Lua script by SHA1 digest.

An error the script returns fails the call.

EVALSHA sha1 numkeys [ key [ key ... ] ] [ arg [ arg ... ] ] https://valkey.io/commands/evalsha/

async functionevalsha-ro: async func( connection: borrow<connection>, sha1: string, keys: option<list<string>>, args: option<list<string-or-bytes>>, ) -> result<resp-value, error-code>since 0.3.0-dev

Executes a read-only server-side Lua script by SHA1 digest.

An error the script returns fails the call.

EVALSHA_RO sha1 numkeys [ key [ key ... ] ] [ arg [ arg ... ] ] https://valkey.io/commands/evalsha_ro/

async functionfcall: async func( connection: borrow<connection>, function: string, keys: option<list<string>>, args: option<list<string-or-bytes>>, ) -> result<resp-value, error-code>since 0.3.0-dev

Invokes a function.

An error the function returns fails the call.

FCALL function numkeys [ key [ key ... ] ] [ arg [ arg ... ] ] https://valkey.io/commands/fcall/

async functionfcall-ro: async func( connection: borrow<connection>, function: string, keys: option<list<string>>, args: option<list<string-or-bytes>>, ) -> result<resp-value, error-code>since 0.3.0-dev

Invokes a read-only function.

An error the function returns fails the call.

FCALL_RO function numkeys [ key [ key ... ] ] [ arg [ arg ... ] ] https://valkey.io/commands/fcall_ro/

async functionfunction-delete: async func( connection: borrow<connection>, library-name: string, ) -> result<_, error-code>since 0.3.0-dev

Deletes a library and its functions.

FUNCTION DELETE library-name https://valkey.io/commands/function-delete/

async functionfunction-dump: async func( connection: borrow<connection>, ) -> result<bytes, error-code>since 0.3.0-dev

Dumps all libraries into a serialized binary payload.

FUNCTION DUMP https://valkey.io/commands/function-dump/

async functionfunction-flush: async func( connection: borrow<connection>, mode: option<flush-mode>, ) -> result<_, error-code>since 0.3.0-dev

Deletes all libraries and functions.

FUNCTION FLUSH [ ASYNC | SYNC ] https://valkey.io/commands/function-flush/

async functionfunction-kill: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Terminates a function during execution.

FUNCTION KILL https://valkey.io/commands/function-kill/

async functionfunction-list: async func( connection: borrow<connection>, library-name-pattern: option<string>, withcode: bool, ) -> result<list<function-list-library>, error-code>since 0.3.0-dev

Returns information about all libraries.

FUNCTION LIST [ LIBRARYNAME library-name-pattern ] [ WITHCODE ] https://valkey.io/commands/function-list/

async functionfunction-load: async func( connection: borrow<connection>, replace: bool, function-code: string, ) -> result<string, error-code>since 0.3.0-dev

Creates a library.

FUNCTION LOAD [ REPLACE ] function-code https://valkey.io/commands/function-load/

async functionfunction-restore: async func( connection: borrow<connection>, serialized-value: bytes, policy: option<function-restore-policy>, ) -> result<_, error-code>since 0.3.0-dev

Restores all libraries from a payload.

FUNCTION RESTORE serialized-value [ FLUSH | APPEND | REPLACE ] https://valkey.io/commands/function-restore/

async functionfunction-stats: async func( connection: borrow<connection>, ) -> result<function-stats-reply, error-code>since 0.3.0-dev

Returns information about a function during execution.

FUNCTION STATS https://valkey.io/commands/function-stats/

async functionscript-exists: async func( connection: borrow<connection>, sha1s: list<string>, ) -> result<list<bool>, error-code>since 0.3.0-dev

Determines whether server-side Lua scripts exist in the script cache.

SCRIPT EXISTS sha1 [ sha1 ... ] https://valkey.io/commands/script-exists/

async functionscript-flush: async func( connection: borrow<connection>, mode: option<flush-mode>, ) -> result<_, error-code>since 0.3.0-dev

Removes all server-side Lua scripts from the script cache.

SCRIPT FLUSH [ ASYNC | SYNC ] https://valkey.io/commands/script-flush/

async functionscript-kill: async func( connection: borrow<connection>, ) -> result<_, error-code>since 0.3.0-dev

Terminates a server-side Lua script during execution.

SCRIPT KILL https://valkey.io/commands/script-kill/

async functionscript-load: async func( connection: borrow<connection>, script: string, ) -> result<string, error-code>since 0.3.0-dev

Loads a server-side Lua script to the script cache.

SCRIPT LOAD script https://valkey.io/commands/script-load/

async functionscript-show: async func( connection: borrow<connection>, sha1: string, ) -> result<string, error-code>since 0.3.0-dev

Show server-side Lua script in the script cache.

SCRIPT SHOW sha1 https://valkey.io/commands/script-show/

async functionsadd: async func( connection: borrow<connection>, key: string, members: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Adds one or more members to a set.

SADD key member [ member ... ] https://valkey.io/commands/sadd/

async functionscard: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of members in a set.

SCARD key https://valkey.io/commands/scard/

async functionsdiff: async func( connection: borrow<connection>, keys: list<string>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns the difference of multiple sets.

SDIFF key [ key ... ] https://valkey.io/commands/sdiff/

async functionsdiffstore: async func( connection: borrow<connection>, destination: string, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Stores the difference of multiple sets in a key.

SDIFFSTORE destination key [ key ... ] https://valkey.io/commands/sdiffstore/

async functionsinter: async func( connection: borrow<connection>, keys: list<string>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns the intersect of multiple sets.

SINTER key [ key ... ] https://valkey.io/commands/sinter/

async functionsintercard: async func( connection: borrow<connection>, keys: list<string>, limit: option<integer>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of members of the intersect of multiple sets.

SINTERCARD numkeys key [ key ... ] [ LIMIT limit ] https://valkey.io/commands/sintercard/

async functionsinterstore: async func( connection: borrow<connection>, destination: string, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Stores the intersect of multiple sets in a key.

SINTERSTORE destination key [ key ... ] https://valkey.io/commands/sinterstore/

async functionsismember: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<bool, error-code>since 0.3.0-dev

Determines whether a member belongs to a set.

False when the key does not exist.

See also sismember-xx.

SISMEMBER key member https://valkey.io/commands/sismember/

async functionsismember-xx: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<option<bool>, error-code>since 0.3.0-dev

Determines whether a member belongs to a set.

The XX form, none when the key does not exist, rather than false.

See also sismember.

SISMEMBER key member XX https://valkey.io/commands/sismember/

async functionsmembers: async func( connection: borrow<connection>, key: string, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns all members of a set.

SMEMBERS key https://valkey.io/commands/smembers/

async functionsmismember: async func( connection: borrow<connection>, key: string, members: list<string-or-bytes>, ) -> result<list<bool>, error-code>since 0.3.0-dev

Determines whether multiple members belong to a set.

SMISMEMBER key member [ member ... ] https://valkey.io/commands/smismember/

async functionsmove: async func( connection: borrow<connection>, source: string, destination: string, member: string-or-bytes, ) -> result<bool, error-code>since 0.3.0-dev

Moves a member from one set to another.

SMOVE source destination member https://valkey.io/commands/smove/

async functionspop: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns one or more random members from a set after removing them.

Without a count, at most one member.

SPOP key [ count ] https://valkey.io/commands/spop/

async functionsrandmember: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Gets one or multiple random members from a set.

Without a count, at most one member.

SRANDMEMBER key [ count ] https://valkey.io/commands/srandmember/

async functionsrem: async func( connection: borrow<connection>, key: string, members: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Removes one or more members from a set.

SREM key member [ member ... ] https://valkey.io/commands/srem/

async functionsscan: async func( connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>, ) -> result<tuple<option<cursor>, list<string-or-bytes>>, error-code>since 0.3.0-dev

Iterates over members of a set.

SSCAN key cursor [ MATCH pattern ] [ COUNT count ] https://valkey.io/commands/sscan/

async functionsunion: async func( connection: borrow<connection>, keys: list<string>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns the union of multiple sets.

SUNION key [ key ... ] https://valkey.io/commands/sunion/

async functionsunionstore: async func( connection: borrow<connection>, destination: string, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Stores the union of multiple sets in a key.

SUNIONSTORE destination key [ key ... ] https://valkey.io/commands/sunionstore/

async functionsort: async func( connection: borrow<connection>, key: string, opts: option<sort-opts>, ) -> result<list<list<option<string-or-bytes>>>, error-code>since 0.3.0-dev

Sorts the elements in a list, a set, or a sorted set, optionally storing the result.

Each row is the element, or with get, the value of each pattern, none when its key does not exist.

See also sort-store.

SORT key [ BY pattern ] [ LIMIT offset count ] [ GET pattern ... ] [ ASC | DESC ] [ ALPHA ] https://valkey.io/commands/sort/

async functionsort-store: async func( connection: borrow<connection>, key: string, opts: option<sort-opts>, destination: string, ) -> result<integer, error-code>since 0.3.0-dev

Sorts the elements in a list, a set, or a sorted set, optionally storing the result.

The STORE form, storing the elements as a list, returning how many.

See also sort.

SORT key [ BY pattern ] [ LIMIT offset count ] [ GET pattern ... ] [ ASC | DESC ] [ ALPHA ] STORE destination https://valkey.io/commands/sort/

async functionsort-ro: async func( connection: borrow<connection>, key: string, opts: option<sort-ro-opts>, ) -> result<list<list<option<string-or-bytes>>>, error-code>since 0.3.0-dev

Returns the sorted elements of a list, a set, or a sorted set.

Each row is the element, or with get, the value of each pattern, none when its key does not exist.

SORT_RO key [ BY pattern ] [ LIMIT offset count ] [ GET pattern ... ] [ ASC | DESC ] [ ALPHA ] https://valkey.io/commands/sort_ro/

async functionbzmpop: async func( connection: borrow<connection>, timeout: duration-milliseconds, keys: list<string>, end: bzmpop-end, count: option<integer>, ) -> result<option<tuple<string, list<tuple<string-or-bytes, double>>>>, error-code>since 0.3.0-dev

Removes and returns a member by score from one or more sorted sets.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BZMPOP timeout numkeys key [ key ... ] 〈 MIN | MAX 〉 [ COUNT count ] https://valkey.io/commands/bzmpop/

async functionbzpopmax: async func( connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds, ) -> result<option<tuple<string, string-or-bytes, double>>, error-code>since 0.3.0-dev

Removes and returns the member with the highest score from one or more sorted sets.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BZPOPMAX key [ key ... ] timeout https://valkey.io/commands/bzpopmax/

async functionbzpopmin: async func( connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds, ) -> result<option<tuple<string, string-or-bytes, double>>, error-code>since 0.3.0-dev

Removes and returns the member with the lowest score from one or more sorted sets.

Returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

BZPOPMIN key [ key ... ] timeout https://valkey.io/commands/bzpopmin/

async functionzadd: async func( connection: borrow<connection>, key: string, condition: option<zadd-condition>, comparison: option<zadd-comparison>, changed: bool, score-and-members: list<tuple<double, string-or-bytes>>, ) -> result<option<integer>, error-code>since 0.3.0-dev

Adds one or more members to a sorted set, or updates their scores.

See also zadd-incr.

ZADD key [ NX | XX ] [ GT | LT ] [ CH ] score member [ score member ... ] https://valkey.io/commands/zadd/

async functionzadd-incr: async func( connection: borrow<connection>, key: string, condition: option<zadd-condition>, comparison: option<zadd-comparison>, increment: double, member: string-or-bytes, ) -> result<option<double>, error-code>since 0.3.0-dev

Adds one or more members to a sorted set, or updates their scores.

The INCR form, returning the new score, none when the condition or comparison prevented it.

See also zadd.

ZADD key [ NX | XX ] [ GT | LT ] INCR score member https://valkey.io/commands/zadd/

async functionzcard: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of members in a sorted set.

ZCARD key https://valkey.io/commands/zcard/

async functionzcount: async func( connection: borrow<connection>, key: string, min: score-bound, max: score-bound, ) -> result<integer, error-code>since 0.3.0-dev

Returns the count of members in a sorted set that have scores within a range.

ZCOUNT key min max https://valkey.io/commands/zcount/

async functionzdiff: async func( connection: borrow<connection>, keys: list<string>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns the difference between multiple sorted sets.

See also zdiff-withscores.

ZDIFF numkeys key [ key ... ] https://valkey.io/commands/zdiff/

async functionzdiff-withscores: async func( connection: borrow<connection>, keys: list<string>, ) -> result<list<tuple<string-or-bytes, double>>, error-code>since 0.3.0-dev

Returns the difference between multiple sorted sets.

The WITHSCORES form, the members and their scores.

See also zdiff.

ZDIFF numkeys key [ key ... ] WITHSCORES https://valkey.io/commands/zdiff/

async functionzdiffstore: async func( connection: borrow<connection>, destination: string, keys: list<string>, ) -> result<integer, error-code>since 0.3.0-dev

Stores the difference of multiple sorted sets in a key.

ZDIFFSTORE destination numkeys key [ key ... ] https://valkey.io/commands/zdiffstore/

async functionzincrby: async func( connection: borrow<connection>, key: string, increment: double, member: string-or-bytes, ) -> result<double, error-code>since 0.3.0-dev

Increments the score of a member in a sorted set.

ZINCRBY key increment member https://valkey.io/commands/zincrby/

async functionzinter: async func( connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns the intersect of multiple sorted sets.

See also zinter-withscores.

ZINTER numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] https://valkey.io/commands/zinter/

async functionzinter-withscores: async func( connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>, ) -> result<list<tuple<string-or-bytes, double>>, error-code>since 0.3.0-dev

Returns the intersect of multiple sorted sets.

The WITHSCORES form, the members and their combined scores.

See also zinter.

ZINTER numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] WITHSCORES https://valkey.io/commands/zinter/

async functionzintercard: async func( connection: borrow<connection>, keys: list<string>, limit: option<integer>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of members of the intersect of multiple sorted sets.

ZINTERCARD numkeys key [ key ... ] [ LIMIT limit ] https://valkey.io/commands/zintercard/

async functionzinterstore: async func( connection: borrow<connection>, destination: string, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>, ) -> result<integer, error-code>since 0.3.0-dev

Stores the intersect of multiple sorted sets in a key.

ZINTERSTORE destination numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] https://valkey.io/commands/zinterstore/

async functionzlexcount: async func( connection: borrow<connection>, key: string, min: lex-bound, max: lex-bound, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of members in a sorted set within a lexicographical range.

ZLEXCOUNT key min max https://valkey.io/commands/zlexcount/

async functionzmpop: async func( connection: borrow<connection>, keys: list<string>, end: zmpop-end, count: option<integer>, ) -> result<option<tuple<string, list<tuple<string-or-bytes, double>>>>, error-code>since 0.3.0-dev

Returns the highest- or lowest-scoring members from one or more sorted sets after removing them.

ZMPOP numkeys key [ key ... ] 〈 MIN | MAX 〉 [ COUNT count ] https://valkey.io/commands/zmpop/

async functionzmscore: async func( connection: borrow<connection>, key: string, members: list<string-or-bytes>, ) -> result<list<option<double>>, error-code>since 0.3.0-dev

Returns the score of one or more members in a sorted set.

ZMSCORE key member [ member ... ] https://valkey.io/commands/zmscore/

async functionzpopmax: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<tuple<string-or-bytes, double>>, error-code>since 0.3.0-dev

Returns the highest-scoring members from a sorted set after removing them.

Without a count, at most one member.

ZPOPMAX key [ count ] https://valkey.io/commands/zpopmax/

async functionzpopmin: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<tuple<string-or-bytes, double>>, error-code>since 0.3.0-dev

Returns the lowest-scoring members from a sorted set after removing them.

Without a count, at most one member.

ZPOPMIN key [ count ] https://valkey.io/commands/zpopmin/

async functionzrandmember: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns one or more random members from a sorted set.

Without a count, at most one member.

See also zrandmember-withscores.

ZRANDMEMBER key [ count ] https://valkey.io/commands/zrandmember/

async functionzrandmember-withscores: async func( connection: borrow<connection>, key: string, count: integer, ) -> result<list<tuple<string-or-bytes, double>>, error-code>since 0.3.0-dev

Returns one or more random members from a sorted set.

The WITHSCORES form, the members and their scores.

See also zrandmember.

ZRANDMEMBER key count WITHSCORES https://valkey.io/commands/zrandmember/

async functionzrange: async func( connection: borrow<connection>, key: string, range: zrange-by, rev: bool, limit: option<limit>, xx: bool, ) -> result<option<list<string-or-bytes>>, error-code>since 0.3.0-dev

Returns members in a sorted set within a range of indexes.

Also covers ZRANGEBYLEX, ZRANGEBYSCORE, ZREVRANGE, ZREVRANGEBYLEX and ZREVRANGEBYSCORE. A limit fails the command unless the range is by score or by lex. With xx, returns none when the key does not exist.

See also zrange-withscores.

ZRANGE key start stop [ BYSCORE | BYLEX ] [ REV ] [ LIMIT offset count ] [ XX ] https://valkey.io/commands/zrange/

async functionzrange-withscores: async func( connection: borrow<connection>, key: string, range: zrange-withscores-by, rev: bool, limit: option<limit>, xx: bool, ) -> result<option<list<tuple<string-or-bytes, double>>>, error-code>since 0.3.0-dev

Returns members in a sorted set within a range of indexes.

The WITHSCORES form, the members and their scores. A limit fails the command unless the range is by score. With xx, returns none when the key does not exist.

See also zrange.

ZRANGE key start stop [ BYSCORE ] [ REV ] [ LIMIT offset count ] WITHSCORES [ XX ] https://valkey.io/commands/zrange/

async functionzrangestore: async func( connection: borrow<connection>, destination: string, source: string, range: zrangestore-by, rev: bool, limit: option<limit>, ) -> result<integer, error-code>since 0.3.0-dev

Stores a range of members from sorted set in a key.

A limit fails the command unless the range is by score or by lex.

ZRANGESTORE dst src min max [ BYSCORE | BYLEX ] [ REV ] [ LIMIT offset count ] https://valkey.io/commands/zrangestore/

async functionzrank: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<option<integer>, error-code>since 0.3.0-dev

Returns the index of a member in a sorted set ordered by ascending scores.

See also zrank-withscore.

ZRANK key member https://valkey.io/commands/zrank/

async functionzrank-withscore: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<option<tuple<integer, double>>, error-code>since 0.3.0-dev

Returns the index of a member in a sorted set ordered by ascending scores.

The WITHSCORE form, the position and the score.

See also zrank.

ZRANK key member WITHSCORE https://valkey.io/commands/zrank/

async functionzrem: async func( connection: borrow<connection>, key: string, members: list<string-or-bytes>, ) -> result<integer, error-code>since 0.3.0-dev

Removes one or more members from a sorted set.

ZREM key member [ member ... ] https://valkey.io/commands/zrem/

async functionzremrangebylex: async func( connection: borrow<connection>, key: string, min: lex-bound, max: lex-bound, ) -> result<integer, error-code>since 0.3.0-dev

Removes members in a sorted set within a lexicographical range.

ZREMRANGEBYLEX key min max https://valkey.io/commands/zremrangebylex/

async functionzremrangebyrank: async func( connection: borrow<connection>, key: string, start: integer, stop: integer, ) -> result<integer, error-code>since 0.3.0-dev

Removes members in a sorted set within a range of indexes.

ZREMRANGEBYRANK key start stop https://valkey.io/commands/zremrangebyrank/

async functionzremrangebyscore: async func( connection: borrow<connection>, key: string, min: score-bound, max: score-bound, ) -> result<integer, error-code>since 0.3.0-dev

Removes members in a sorted set within a range of scores.

ZREMRANGEBYSCORE key min max https://valkey.io/commands/zremrangebyscore/

async functionzrevrank: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<option<integer>, error-code>since 0.3.0-dev

Returns the index of a member in a sorted set ordered by descending scores.

See also zrevrank-withscore.

ZREVRANK key member https://valkey.io/commands/zrevrank/

async functionzrevrank-withscore: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<option<tuple<integer, double>>, error-code>since 0.3.0-dev

Returns the index of a member in a sorted set ordered by descending scores.

The WITHSCORE form, the position and the score.

See also zrevrank.

ZREVRANK key member WITHSCORE https://valkey.io/commands/zrevrank/

async functionzscan: async func( connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>, ) -> result<tuple<option<cursor>, list<tuple<string-or-bytes, double>>>, error-code>since 0.3.0-dev

Iterates over members and scores of a sorted set.

See also zscan-noscores.

ZSCAN key cursor [ MATCH pattern ] [ COUNT count ] https://valkey.io/commands/zscan/

async functionzscan-noscores: async func( connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>, ) -> result<tuple<option<cursor>, list<string-or-bytes>>, error-code>since 0.3.0-dev

Iterates over members and scores of a sorted set.

The NOSCORES form, the members only.

See also zscan.

ZSCAN key cursor [ MATCH pattern ] [ COUNT count ] NOSCORES https://valkey.io/commands/zscan/

async functionzscore: async func( connection: borrow<connection>, key: string, member: string-or-bytes, ) -> result<option<double>, error-code>since 0.3.0-dev

Returns the score of a member in a sorted set.

ZSCORE key member https://valkey.io/commands/zscore/

async functionzunion: async func( connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>, ) -> result<list<string-or-bytes>, error-code>since 0.3.0-dev

Returns the union of multiple sorted sets.

See also zunion-withscores.

ZUNION numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] https://valkey.io/commands/zunion/

async functionzunion-withscores: async func( connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>, ) -> result<list<tuple<string-or-bytes, double>>, error-code>since 0.3.0-dev

Returns the union of multiple sorted sets.

The WITHSCORES form, the members and their combined scores.

See also zunion.

ZUNION numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] WITHSCORES https://valkey.io/commands/zunion/

async functionzunionstore: async func( connection: borrow<connection>, destination: string, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>, ) -> result<integer, error-code>since 0.3.0-dev

Stores the union of multiple sorted sets in a key.

ZUNIONSTORE destination numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] https://valkey.io/commands/zunionstore/

async functionxack: async func( connection: borrow<connection>, key: string, group: string, ids: list<stream-id>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.

XACK key group ID [ ID ... ] https://valkey.io/commands/xack/

async functionxadd: async func( connection: borrow<connection>, key: string, nomkstream: bool, trim: option<stream-trim>, id: stream-id, field-and-values: list<tuple<string, string-or-bytes>>, ) -> result<option<stream-id>, error-code>since 0.3.0-dev

Appends a new message to a stream.

XADD key [ NOMKSTREAM ] [ 〈 MAXLEN | MINID 〉 [ = | ~ ] threshold [ LIMIT count ] ] 〈 * | id 〉 field value [ field value ... ] https://valkey.io/commands/xadd/

async functionxautoclaim: async func( connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, start: option<stream-id>, count: option<integer>, ) -> result<tuple<option<stream-id>, list<tuple<stream-id, map<string, string-or-bytes>>>, list<stream-id>>, error-code>since 0.3.0-dev

Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to a consumer group member.

A start of none scans from the beginning, 0-0. The next start is returned, none once the scan is complete.

See also xautoclaim-justid.

XAUTOCLAIM key group consumer min-idle-time start [ COUNT count ] https://valkey.io/commands/xautoclaim/

async functionxautoclaim-justid: async func( connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, start: option<stream-id>, count: option<integer>, ) -> result<tuple<option<stream-id>, list<stream-id>, list<stream-id>>, error-code>since 0.3.0-dev

Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to a consumer group member.

The JUSTID form, the IDs only. A start of none scans from the beginning, 0-0. The next start is returned, none once the scan is complete.

See also xautoclaim.

XAUTOCLAIM key group consumer min-idle-time start [ COUNT count ] JUSTID https://valkey.io/commands/xautoclaim/

async functionxclaim: async func( connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, ids: list<stream-id>, opts: option<xclaim-opts>, ) -> result<list<tuple<stream-id, map<string, string-or-bytes>>>, error-code>since 0.3.0-dev

Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered to a consumer group member.

See also xclaim-justid.

XCLAIM key group consumer min-idle-time ID [ ID ... ] [ IDLE ms ] [ TIME unix-time-milliseconds ] [ RETRYCOUNT count ] [ FORCE ] [ LASTID lastid ] https://valkey.io/commands/xclaim/

async functionxclaim-justid: async func( connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, ids: list<stream-id>, opts: option<xclaim-opts>, ) -> result<list<stream-id>, error-code>since 0.3.0-dev

Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered to a consumer group member.

The JUSTID form, the IDs only.

See also xclaim.

XCLAIM key group consumer min-idle-time ID [ ID ... ] [ IDLE ms ] [ TIME unix-time-milliseconds ] [ RETRYCOUNT count ] [ FORCE ] JUSTID [ LASTID lastid ] https://valkey.io/commands/xclaim/

async functionxdel: async func( connection: borrow<connection>, key: string, ids: list<stream-id>, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of messages after removing them from a stream.

XDEL key ID [ ID ... ] https://valkey.io/commands/xdel/

async functionxgroup-create: async func( connection: borrow<connection>, key: string, group: string, id: stream-id, mkstream: bool, entriesread: option<integer>, ) -> result<_, error-code>since 0.3.0-dev

Creates a consumer group.

XGROUP CREATE key group 〈 id | $ 〉 [ MKSTREAM ] [ ENTRIESREAD entriesread ] https://valkey.io/commands/xgroup-create/

async functionxgroup-createconsumer: async func( connection: borrow<connection>, key: string, group: string, consumer: string, ) -> result<bool, error-code>since 0.3.0-dev

Creates a consumer in a consumer group.

XGROUP CREATECONSUMER key group consumer https://valkey.io/commands/xgroup-createconsumer/

async functionxgroup-delconsumer: async func( connection: borrow<connection>, key: string, group: string, consumer: string, ) -> result<integer, error-code>since 0.3.0-dev

Deletes a consumer from a consumer group.

XGROUP DELCONSUMER key group consumer https://valkey.io/commands/xgroup-delconsumer/

async functionxgroup-destroy: async func( connection: borrow<connection>, key: string, group: string, ) -> result<bool, error-code>since 0.3.0-dev

Destroys a consumer group.

XGROUP DESTROY key group https://valkey.io/commands/xgroup-destroy/

async functionxgroup-setid: async func( connection: borrow<connection>, key: string, group: string, id: stream-id, entriesread: option<integer>, ) -> result<_, error-code>since 0.3.0-dev

Sets the last-delivered ID of a consumer group.

XGROUP SETID key group 〈 id | $ 〉 [ ENTRIESREAD entriesread ] https://valkey.io/commands/xgroup-setid/

async functionxinfo-consumers: async func( connection: borrow<connection>, key: string, group: string, ) -> result<list<xinfo-consumers-entry>, error-code>since 0.3.0-dev

Returns a list of the consumers in a consumer group.

XINFO CONSUMERS key group https://valkey.io/commands/xinfo-consumers/

async functionxinfo-groups: async func( connection: borrow<connection>, key: string, ) -> result<list<xinfo-groups-entry>, error-code>since 0.3.0-dev

Returns a list of the consumer groups of a stream.

XINFO GROUPS key https://valkey.io/commands/xinfo-groups/

async functionxinfo-stream: async func( connection: borrow<connection>, key: string, ) -> result<xinfo-stream-reply, error-code>since 0.3.0-dev

Returns information about a stream.

See also xinfo-stream-full.

XINFO STREAM key https://valkey.io/commands/xinfo-stream/

async functionxinfo-stream-full: async func( connection: borrow<connection>, key: string, count: option<integer>, ) -> result<xinfo-stream-reply-full, error-code>since 0.3.0-dev

Returns information about a stream.

The FULL form, with the entries, groups and consumers.

See also xinfo-stream.

XINFO STREAM key FULL [ COUNT count ] https://valkey.io/commands/xinfo-stream/

async functionxlen: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the number of messages in a stream.

XLEN key https://valkey.io/commands/xlen/

async functionxpending: async func( connection: borrow<connection>, key: string, group: string, ) -> result<xpending-summary, error-code>since 0.3.0-dev

Returns the information and entries from a stream consumer group's pending entries list.

The summary form.

See also xpending-extended.

XPENDING key group https://valkey.io/commands/xpending/

async functionxpending-extended: async func( connection: borrow<connection>, key: string, group: string, min-idle-time: option<duration-milliseconds>, start: stream-id, end: stream-id, count: integer, consumer: option<string>, ) -> result<list<xpending-extended-entry>, error-code>since 0.3.0-dev

Returns the information and entries from a stream consumer group's pending entries list.

The extended form, the pending entries in the range.

See also xpending.

XPENDING key group [ IDLE min-idle-time ] start end count [ consumer ] https://valkey.io/commands/xpending/

async functionxrange: async func( connection: borrow<connection>, key: string, start: stream-id, end: stream-id, count: option<integer>, ) -> result<list<tuple<stream-id, map<string, string-or-bytes>>>, error-code>since 0.3.0-dev

Returns the messages from a stream within a range of IDs.

XRANGE key start end [ COUNT count ] https://valkey.io/commands/xrange/

async functionxread: async func( connection: borrow<connection>, count: option<integer>, block: option<duration-milliseconds>, keys: list<string>, ids: list<stream-id>, ) -> result<option<map<string, list<tuple<stream-id, map<string, string-or-bytes>>>>>, error-code>since 0.3.0-dev

Returns messages from multiple streams with IDs greater than the ones requested.

With block, returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

XREAD [ COUNT count ] [ BLOCK milliseconds ] STREAMS key [ key ... ] ID [ ID ... ] https://valkey.io/commands/xread/

async functionxreadgroup: async func( connection: borrow<connection>, group: string, consumer: string, count: option<integer>, block: option<duration-milliseconds>, noack: bool, keys: list<string>, ids: list<stream-id>, ) -> result<option<map<string, list<tuple<stream-id, option<map<string, string-or-bytes>>>>>>, error-code>since 0.3.0-dev

Returns new or historical messages from a stream for a consumer in a group.

The fields of an entry are none when it was deleted after it was delivered, e.g. when reading the pending entries with the ID 0.

With block, returns none when the timeout passed. The connection waits too, replies to commands sent after it on the connection wait behind it. Use a connection of your own.

XREADGROUP GROUP group consumer [ COUNT count ] [ BLOCK milliseconds ] [ NOACK ] STREAMS key [ key ... ] ID [ ID ... ] https://valkey.io/commands/xreadgroup/

async functionxrevrange: async func( connection: borrow<connection>, key: string, end: stream-id, start: stream-id, count: option<integer>, ) -> result<list<tuple<stream-id, map<string, string-or-bytes>>>, error-code>since 0.3.0-dev

Returns the messages from a stream within a range of IDs in reverse order.

XREVRANGE key end start [ COUNT count ] https://valkey.io/commands/xrevrange/

async functionxsetid: async func( connection: borrow<connection>, key: string, last-id: stream-id, entries-added: option<integer>, max-deleted-id: option<stream-id>, ) -> result<_, error-code>since 0.3.0-dev

An internal command for replicating stream values.

XSETID key last-id [ ENTRIESADDED entries-added ] [ MAXDELETEDID max-deleted-id ] https://valkey.io/commands/xsetid/

async functionxtrim: async func( connection: borrow<connection>, key: string, trim: stream-trim, ) -> result<integer, error-code>since 0.3.0-dev

Deletes messages from the beginning of a stream.

XTRIM key 〈 MAXLEN | MINID 〉 [ = | ~ ] threshold [ LIMIT count ] https://valkey.io/commands/xtrim/

async functionappend: async func( connection: borrow<connection>, key: string, value: string-or-bytes, ) -> result<integer, error-code>since 0.3.0-dev

Appends a string to the value of a key.

APPEND key value https://valkey.io/commands/append/

async functiondecr: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Decrements the integer value of a key by one.

DECR key https://valkey.io/commands/decr/

async functiondecrby: async func( connection: borrow<connection>, key: string, decrement: integer, ) -> result<integer, error-code>since 0.3.0-dev

Decrements the integer value of a key by a number.

DECRBY key decrement https://valkey.io/commands/decrby/

async functiondelifeq: async func( connection: borrow<connection>, key: string, value: string-or-bytes, ) -> result<bool, error-code>since 0.3.0-dev

Delete key if value matches string.

DELIFEQ key value https://valkey.io/commands/delifeq/

async functionget: async func( connection: borrow<connection>, key: string, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns the string value of a key.

GET key https://valkey.io/commands/get/

async functiongetdel: async func( connection: borrow<connection>, key: string, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns the string value of a key after deleting the key.

GETDEL key https://valkey.io/commands/getdel/

async functiongetex: async func( connection: borrow<connection>, key: string, ttl: option<getex-ttl>, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns the string value of a key after setting its expiration time.

GETEX key [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST ] https://valkey.io/commands/getex/

async functiongetrange: async func( connection: borrow<connection>, key: string, start: integer, end: integer, ) -> result<string-or-bytes, error-code>since 0.3.0-dev

Returns a substring of the string stored at a key.

GETRANGE key start end https://valkey.io/commands/getrange/

async functiongetset: async func( connection: borrow<connection>, key: string, value: string-or-bytes, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Returns the previous string value of a key after setting it to a new value.

GETSET key value https://valkey.io/commands/getset/

async functionincr: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Increments the integer value of a key by one.

INCR key https://valkey.io/commands/incr/

async functionincrby: async func( connection: borrow<connection>, key: string, increment: integer, ) -> result<integer, error-code>since 0.3.0-dev

Increments the integer value of a key by a number.

INCRBY key increment https://valkey.io/commands/incrby/

async functionincrbyfloat: async func( connection: borrow<connection>, key: string, increment: double, ) -> result<double, error-code>since 0.3.0-dev

Increments the floating point value of a key by a number.

INCRBYFLOAT key increment https://valkey.io/commands/incrbyfloat/

async functionlcs: async func( connection: borrow<connection>, key1: string, key2: string, ) -> result<string-or-bytes, error-code>since 0.3.0-dev

Finds the longest common substring.

See also lcs-len and lcs-idx.

LCS key1 key2 https://valkey.io/commands/lcs/

async functionlcs-len: async func( connection: borrow<connection>, key1: string, key2: string, ) -> result<integer, error-code>since 0.3.0-dev

Finds the longest common substring.

The LEN form, the length only.

See also lcs and lcs-idx.

LCS key1 key2 LEN https://valkey.io/commands/lcs/

async functionlcs-idx: async func( connection: borrow<connection>, key1: string, key2: string, min-match-len: option<integer>, with-match-len: bool, ) -> result<lcs-idx-reply, error-code>since 0.3.0-dev

Finds the longest common substring.

The IDX form, the ranges of the matches.

See also lcs and lcs-len.

LCS key1 key2 IDX [ MINMATCHLEN min-match-len ] [ WITHMATCHLEN ] https://valkey.io/commands/lcs/

async functionmget: async func( connection: borrow<connection>, keys: list<string>, ) -> result<list<option<string-or-bytes>>, error-code>since 0.3.0-dev

Atomically returns the string values of one or more keys.

MGET key [ key ... ] https://valkey.io/commands/mget/

async functionmset: async func( connection: borrow<connection>, keys-and-values: list<tuple<string, string-or-bytes>>, ) -> result<_, error-code>since 0.3.0-dev

Atomically creates or modifies the string values of one or more keys.

MSET key value [ key value ... ] https://valkey.io/commands/mset/

async functionmsetex: async func( connection: borrow<connection>, keys-and-values: list<tuple<string, string-or-bytes>>, precondition: option<msetex-precondition>, ttl: option<msetex-ttl>, ) -> result<bool, error-code>since 0.3.0-dev

Atomically creates or modifies the string values of one or more keys, and optionally set their expiration.

MSETEX numkeys key value [ key value ... ] [ NX | XX ] [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ] https://valkey.io/commands/msetex/

async functionmsetnx: async func( connection: borrow<connection>, keys-and-values: list<tuple<string, string-or-bytes>>, ) -> result<bool, error-code>since 0.3.0-dev

Atomically modifies the string values of one or more keys only when all keys don't exist.

MSETNX key value [ key value ... ] https://valkey.io/commands/msetnx/

async functionpsetex: async func( connection: borrow<connection>, key: string, milliseconds: duration-milliseconds, value: string-or-bytes, ) -> result<_, error-code>since 0.3.0-dev

Sets both string value and expiration time in milliseconds of a key.

PSETEX key milliseconds value https://valkey.io/commands/psetex/

async functionset: async func( connection: borrow<connection>, key: string, value: string-or-bytes, precondition: option<set-precondition>, ttl: option<set-ttl>, ) -> result<bool, error-code>since 0.3.0-dev

Sets the string value of a key, ignoring its type.

Returns false when the precondition is not met, the key is unchanged.

See also set-get.

SET key value [ NX | XX | IFEQ comparison-value | IFNE comparison-not-equal ] [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ] https://valkey.io/commands/set/

async functionset-get: async func( connection: borrow<connection>, key: string, value: string-or-bytes, precondition: option<set-precondition>, ttl: option<set-ttl>, ) -> result<option<string-or-bytes>, error-code>since 0.3.0-dev

Sets the string value of a key, ignoring its type.

The GET form, returning the previous value, none when the key did not exist.

See also set.

SET key value [ NX | XX | IFEQ comparison-value | IFNE comparison-not-equal ] GET [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ] https://valkey.io/commands/set/

async functionsetex: async func( connection: borrow<connection>, key: string, seconds: duration-seconds, value: string-or-bytes, ) -> result<_, error-code>since 0.3.0-dev

Sets the string value and expiration time of a key.

SETEX key seconds value https://valkey.io/commands/setex/

async functionsetnx: async func( connection: borrow<connection>, key: string, value: string-or-bytes, ) -> result<bool, error-code>since 0.3.0-dev

Sets the string value of a key only when the key doesn't exist.

SETNX key value https://valkey.io/commands/setnx/

async functionsetrange: async func( connection: borrow<connection>, key: string, offset: u32, value: string-or-bytes, ) -> result<integer, error-code>since 0.3.0-dev

Overwrites a part of a string value with another by an offset.

SETRANGE key offset value https://valkey.io/commands/setrange/

async functionstrlen: async func( connection: borrow<connection>, key: string, ) -> result<integer, error-code>since 0.3.0-dev

Returns the length of a string value.

STRLEN key https://valkey.io/commands/strlen/

async functionsubstr: async func( connection: borrow<connection>, key: string, start: integer, end: integer, ) -> result<string-or-bytes, error-code>since 0.3.0-dev

Returns a substring from a string value.

SUBSTR key start end https://valkey.io/commands/substr/

WIT

/// Typed functions for Valkey's commands, over the mechanics of a connection.
///
/// Each function sends one command and converts its reply. The docs of a function cover what
/// differs from the raw command, see the linked Valkey docs for what the command does. Commands
/// that change the state of the connection itself are on the connection, e.g. SUBSCRIBE, MULTI and
/// EXEC, WATCH, RESET and HELLO.
///
/// The types are those of the `types` interface, used here under names that may change, e.g.
/// renamed to avoid clashing with a function for a new command. Refer to a type through `types`
/// for a name that does not change.
///
/// The functions follow these idioms:
///
/// - Arguments are in the order of the command's words.
/// - A list argument must have at least one item, as the command requires, an empty list fails with
///   a client error before anything is sent. A list the command allows to be left out is an
///   option, none rather than empty.
/// - An optional argument is an option, a flag is a bool, e.g. `replace` for `REPLACE`, and a
///   choice of keywords is an enum or a variant, e.g. `list-side` for `LEFT | RIGHT`.
/// - Durations and points in time are records named for their unit, e.g. `duration-seconds` and
///   `unix-time-milliseconds`.
/// - Keys, fields, patterns and names are `string`. Values, members and payloads are
///   `string-or-bytes`, a reply that is not UTF-8 is `bytes`. Values that are binary by nature, like
///   the serialized values of DUMP and RESTORE, are `bytes`. A reply where a `string` is expected
///   that is not UTF-8 fails with a client error.
/// - A null reply is none, e.g. GET of a key that does not exist.
/// - An integer reply that is `0` or `1` is a bool, e.g. whether HSETNX set the field.
/// - An integer reply with sentinel values is a variant or an enum with a case for each, e.g.
///   `ttl-reply` for TTL's `-2` and `-1`, or none when it stands for nothing, e.g. BITPOS's `-1`.
/// - A reply whose shape an option changes, e.g. with `WITHSCORES`, has a function of its own for
///   that form, e.g. `zrange-withscores`, its docs naming the other forms.
/// - A scan starts with the `start` cursor and resumes with the one it returned, none once it is
///   complete.
/// - An error reply fails with a `server` error. Arguments the client rejects, and replies it cannot
///   convert, fail with a `client` error.
/// - A command that blocks, e.g. BLPOP, or changes the state of the connection, e.g. SELECT,
///   affects every caller sharing the connection, see the command's docs.
interface commands {
  @since(version = 0.3.0-dev)
  use connection.{connection};
  @since(version = 0.3.0-dev)
  use types.{double, error-code, integer, resp-value, duration-seconds, duration-milliseconds, unix-time-seconds, unix-time-milliseconds, cursor, ttl-mode, hexpire-result, hpexpireat-result, hpexpire-result, hexpireat-result, ttl-reply, httl-reply, pttl-reply, hpttl-reply, expiretime-reply, hexpiretime-reply, pexpiretime-reply, hpexpiretime-reply, acl-dryrun-result, acl-log-entry, bgsave-operation, client-type, client-filter, client-pause-mode, client-unblock-type, cluster-bumpepoch-result, cluster-failover-mode, cluster-getslotmigrations-operation, cluster-getslotmigrations-entry, cluster-migrateslots-group, cluster-reset-mode, cluster-setslot-state, commandlog-type, commandlog-entry, slowlog-entry, failover-target, latency-histogram-entry, latency-latest-entry, module-list-entry, role-primary-replica, role-primary, role-replica, role-reply, shutdown-flags, shutdown-save, acl-list-entry, acl-rule, acl-selector-rule, acl-key-rule, acl-channel-rule, acl-command-rule, acl-db-rule, acl-user-rule, bit-range, bitfield-encoding, bitfield-offset, bitfield-overflow, bitfield-get, bitfield-ro-get, bitfield-set, bitfield-incrby, bitfield-operation, bitop-operation, command-key-spec-begin-search, command-key-spec-keyword, command-key-spec-find-keys, command-key-spec-range, command-key-spec-keynum, command-key-spec, command-info-reply, command-reply, command-docs-argument-type, command-docs-argument, command-docs-reply, client-setinfo-attr, client-tracking-mode, client-tracking-options, client-trackinginfo-redirect, client-trackinginfo-reply, command-list-filter, geo-coordinates, geo-unit, geoadd-condition, geosearch-from, geosearch-radius, geosearch-box, geosearch-shape, geosearchstore-shape, geosearch-count, geosearchstore-count, geosearch-with-flags, geosearch-with-result, hpersist-result, hsetex-condition, hsetex-field-condition, key-type, migrate-flags, migrate-auth, list-side, linsert-position, linsert-result, flush-mode, function-list-function, function-list-library, function-stats-running, function-stats-engine, function-stats-reply, limit, sort-opts, sort-ro-opts, sort-order, score-bound, lex-bound, zmpop-end, bzmpop-end, zset-aggregate, zrange-by, zrangestore-by, zrange-withscores-by, zadd-condition, zadd-comparison, stream-id, stream-trim, stream-trim-maxlen, stream-trim-minid, stream-trim-efficiency, xclaim-opts, xinfo-consumers-entry, xinfo-groups-entry, xinfo-stream-reply, xinfo-stream-reply-full, xinfo-stream-reply-full-group, xinfo-stream-reply-full-consumer, xpending-summary, xpending-extended-entry, getex-ttl, hgetex-ttl, lcs-idx-reply, lcs-idx-match, msetex-precondition, msetex-ttl, set-precondition, set-ttl, hsetex-ttl, bytes, string-or-bytes, restore-ttl, function-restore-policy};

  /// Lists the ACL categories, or the commands inside a category.
  ///
  /// ACL CAT [ category ]
  /// https://valkey.io/commands/acl-cat/
  @since(version = 0.3.0-dev)
  acl-cat: async func(connection: borrow<connection>, category: option<string>) -> result<list<string>, error-code>;

  /// Deletes ACL users, and terminates their connections.
  ///
  /// ACL DELUSER username [ username ... ]
  /// https://valkey.io/commands/acl-deluser/
  @since(version = 0.3.0-dev)
  acl-deluser: async func(connection: borrow<connection>, usernames: list<string>) -> result<integer, error-code>;

  /// Simulates the execution of a command by a user, without executing the command.
  ///
  /// ACL DRYRUN username command [ arg [ arg ... ] ]
  /// https://valkey.io/commands/acl-dryrun/
  @since(version = 0.3.0-dev)
  acl-dryrun: async func(connection: borrow<connection>, username: string, command: list<string>) -> result<acl-dryrun-result, error-code>;

  /// Generates a pseudorandom, secure password that can be used to identify ACL users.
  ///
  /// ACL GENPASS [ bits ]
  /// https://valkey.io/commands/acl-genpass/
  @since(version = 0.3.0-dev)
  acl-genpass: async func(connection: borrow<connection>, bits: option<integer>) -> result<string, error-code>;

  /// Lists the ACL rules of a user.
  ///
  /// None when the user does not exist. The rules are as the server normalized them, e.g.
  /// `allkeys` is `~*`. Applied with `acl-setuser`, after `reset`, they recreate the user.
  ///
  /// ACL GETUSER username
  /// https://valkey.io/commands/acl-getuser/
  @since(version = 0.3.0-dev)
  acl-getuser: async func(connection: borrow<connection>, username: string) -> result<option<list<acl-rule>>, error-code>;

  /// Dumps the effective rules in ACL file format.
  ///
  /// ACL LIST
  /// https://valkey.io/commands/acl-list/
  @since(version = 0.3.0-dev)
  acl-list: async func(connection: borrow<connection>) -> result<list<acl-list-entry>, error-code>;

  /// Reloads the rules from the configured ACL file.
  ///
  /// ACL LOAD
  /// https://valkey.io/commands/acl-load/
  @since(version = 0.3.0-dev)
  acl-load: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Lists recent security events generated due to ACL rules.
  ///
  /// See also `acl-log-reset`.
  ///
  /// ACL LOG [ count ]
  /// https://valkey.io/commands/acl-log/
  @since(version = 0.3.0-dev)
  acl-log: async func(connection: borrow<connection>, count: option<integer>) -> result<list<acl-log-entry>, error-code>;

  /// Lists recent security events generated due to ACL rules.
  ///
  /// The `RESET` form, clearing the security events.
  ///
  /// See also `acl-log`.
  ///
  /// ACL LOG RESET
  /// https://valkey.io/commands/acl-log/
  @since(version = 0.3.0-dev)
  acl-log-reset: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Saves the effective ACL rules in the configured ACL file.
  ///
  /// ACL SAVE
  /// https://valkey.io/commands/acl-save/
  @since(version = 0.3.0-dev)
  acl-save: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Creates and modifies an ACL user and its rules.
  ///
  /// ACL SETUSER username [ rule ] [ [ rule ] ... ]
  /// https://valkey.io/commands/acl-setuser/
  @since(version = 0.3.0-dev)
  acl-setuser: async func(connection: borrow<connection>, username: string, rules: option<list<acl-rule>>) -> result<_, error-code>;

  /// Lists all ACL users.
  ///
  /// ACL USERS
  /// https://valkey.io/commands/acl-users/
  @since(version = 0.3.0-dev)
  acl-users: async func(connection: borrow<connection>) -> result<list<string>, error-code>;

  /// Returns the authenticated username of the current connection.
  ///
  /// ACL WHOAMI
  /// https://valkey.io/commands/acl-whoami/
  @since(version = 0.3.0-dev)
  acl-whoami: async func(connection: borrow<connection>) -> result<string, error-code>;

  /// Asynchronously rewrites the append-only file to disk.
  ///
  /// BGREWRITEAOF
  /// https://valkey.io/commands/bgrewriteaof/
  @since(version = 0.3.0-dev)
  bgrewriteaof: async func(connection: borrow<connection>) -> result<string, error-code>;

  /// Asynchronously saves the database(s) to disk.
  ///
  /// BGSAVE [ SCHEDULE | CANCEL ]
  /// https://valkey.io/commands/bgsave/
  @since(version = 0.3.0-dev)
  bgsave: async func(connection: borrow<connection>, operation: option<bgsave-operation>) -> result<string, error-code>;

  /// Terminates open connections.
  ///
  /// CLIENT KILL filter [ filter ... ]
  /// https://valkey.io/commands/client-kill/
  @since(version = 0.3.0-dev)
  client-kill: async func(connection: borrow<connection>, filters: list<client-filter>) -> result<integer, error-code>;

  /// Lists open connections.
  ///
  /// Each connection is a map of its fields, parsed from the server's text, e.g. `id`, `addr` and
  /// `name`.
  ///
  /// CLIENT LIST [ filter [ filter ... ] ]
  /// https://valkey.io/commands/client-list/
  @since(version = 0.3.0-dev)
  client-list: async func(connection: borrow<connection>, filters: option<list<client-filter>>) -> result<list<map<string, string>>, error-code>;

  /// Sets the client eviction mode of the connection.
  ///
  /// It applies to the connection, so to every caller sharing it.
  ///
  /// CLIENT NO-EVICT 〈 ON | OFF 〉
  /// https://valkey.io/commands/client-no-evict/
  @since(version = 0.3.0-dev)
  client-no-evict: async func(connection: borrow<connection>, enabled: bool) -> result<_, error-code>;

  /// Suspends commands processing.
  ///
  /// CLIENT PAUSE timeout [ WRITE | ALL ]
  /// https://valkey.io/commands/client-pause/
  @since(version = 0.3.0-dev)
  client-pause: async func(connection: borrow<connection>, timeout: duration-milliseconds, mode: option<client-pause-mode>) -> result<_, error-code>;

  /// Unblocks a client blocked by a blocking command from a different connection.
  ///
  /// CLIENT UNBLOCK client-id [ TIMEOUT | ERROR ]
  /// https://valkey.io/commands/client-unblock/
  @since(version = 0.3.0-dev)
  client-unblock: async func(connection: borrow<connection>, client-id: integer, unblock-type: option<client-unblock-type>) -> result<bool, error-code>;

  /// Resumes processing commands from paused clients.
  ///
  /// CLIENT UNPAUSE
  /// https://valkey.io/commands/client-unpause/
  @since(version = 0.3.0-dev)
  client-unpause: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Assigns new hash slots to a node.
  ///
  /// CLUSTER ADDSLOTS slot [ slot ... ]
  /// https://valkey.io/commands/cluster-addslots/
  @since(version = 0.3.0-dev)
  cluster-addslots: async func(connection: borrow<connection>, slots: list<u16>) -> result<_, error-code>;

  /// Assigns new hash slot ranges to a node.
  ///
  /// CLUSTER ADDSLOTSRANGE start-slot end-slot [ start-slot end-slot ... ]
  /// https://valkey.io/commands/cluster-addslotsrange/
  @since(version = 0.3.0-dev)
  cluster-addslotsrange: async func(connection: borrow<connection>, ranges: list<tuple<u16, u16>>) -> result<_, error-code>;

  /// Advances the cluster config epoch.
  ///
  /// CLUSTER BUMPEPOCH
  /// https://valkey.io/commands/cluster-bumpepoch/
  @since(version = 0.3.0-dev)
  cluster-bumpepoch: async func(connection: borrow<connection>) -> result<cluster-bumpepoch-result, error-code>;

  /// Cancel all current ongoing slot migration operations.
  ///
  /// CLUSTER CANCELSLOTMIGRATIONS
  /// https://valkey.io/commands/cluster-cancelslotmigrations/
  @since(version = 0.3.0-dev)
  cluster-cancelslotmigrations: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Returns the number of active failure reports for a node.
  ///
  /// CLUSTER COUNT-FAILURE-REPORTS node-id
  /// https://valkey.io/commands/cluster-count-failure-reports/
  @since(version = 0.3.0-dev)
  cluster-count-failure-reports: async func(connection: borrow<connection>, node-id: string) -> result<integer, error-code>;

  /// Sets hash slots as unbound for a node.
  ///
  /// CLUSTER DELSLOTS slot [ slot ... ]
  /// https://valkey.io/commands/cluster-delslots/
  @since(version = 0.3.0-dev)
  cluster-delslots: async func(connection: borrow<connection>, slots: list<u16>) -> result<_, error-code>;

  /// Sets hash slot ranges as unbound for a node.
  ///
  /// CLUSTER DELSLOTSRANGE start-slot end-slot [ start-slot end-slot ... ]
  /// https://valkey.io/commands/cluster-delslotsrange/
  @since(version = 0.3.0-dev)
  cluster-delslotsrange: async func(connection: borrow<connection>, ranges: list<tuple<u16, u16>>) -> result<_, error-code>;

  /// Forces a replica to perform a manual failover of its primary.
  ///
  /// CLUSTER FAILOVER [ FORCE | TAKEOVER ]
  /// https://valkey.io/commands/cluster-failover/
  @since(version = 0.3.0-dev)
  cluster-failover: async func(connection: borrow<connection>, mode: option<cluster-failover-mode>) -> result<_, error-code>;

  /// Deletes all slots information from a node.
  ///
  /// CLUSTER FLUSHSLOTS
  /// https://valkey.io/commands/cluster-flushslots/
  @since(version = 0.3.0-dev)
  cluster-flushslots: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Removes a node from the nodes table.
  ///
  /// CLUSTER FORGET node-id
  /// https://valkey.io/commands/cluster-forget/
  @since(version = 0.3.0-dev)
  cluster-forget: async func(connection: borrow<connection>, node-id: string) -> result<_, error-code>;

  /// Gets the status of ongoing and recently finished slot import and export operations.
  ///
  /// CLUSTER GETSLOTMIGRATIONS
  /// https://valkey.io/commands/cluster-getslotmigrations/
  @since(version = 0.3.0-dev)
  cluster-getslotmigrations: async func(connection: borrow<connection>) -> result<list<cluster-getslotmigrations-entry>, error-code>;

  /// Forces a node to handshake with another node.
  ///
  /// CLUSTER MEET ip port [ cluster-bus-port ]
  /// https://valkey.io/commands/cluster-meet/
  @since(version = 0.3.0-dev)
  cluster-meet: async func(connection: borrow<connection>, ip: string, port: u16, cluster-bus-port: option<u16>) -> result<_, error-code>;

  /// Migrate the given slots from this node to the specified nodes.
  ///
  /// CLUSTER MIGRATESLOTS SLOTSRANGE start-slot end-slot [ start-slot end-slot ... ] NODE node-id [ AUTH username password ] [ SLOTSRANGE ... ]
  /// https://valkey.io/commands/cluster-migrateslots/
  @since(version = 0.3.0-dev)
  cluster-migrateslots: async func(connection: borrow<connection>, migrations: list<cluster-migrateslots-group>) -> result<_, error-code>;

  /// Lists the replica nodes of a primary node.
  ///
  /// CLUSTER REPLICAS node-id
  /// https://valkey.io/commands/cluster-replicas/
  @since(version = 0.3.0-dev)
  cluster-replicas: async func(connection: borrow<connection>, node-id: string) -> result<list<string>, error-code>;

  /// Configures a node as replica of a primary node or detaches a replica from its primary.
  ///
  /// None detaches the node from its primary, `NO ONE`.
  ///
  /// CLUSTER REPLICATE 〈 node-id | NO ONE 〉
  /// https://valkey.io/commands/cluster-replicate/
  @since(version = 0.3.0-dev)
  cluster-replicate: async func(connection: borrow<connection>, node-id: option<string>) -> result<_, error-code>;

  /// Resets a node.
  ///
  /// CLUSTER RESET [ HARD | SOFT ]
  /// https://valkey.io/commands/cluster-reset/
  @since(version = 0.3.0-dev)
  cluster-reset: async func(connection: borrow<connection>, mode: option<cluster-reset-mode>) -> result<_, error-code>;

  /// Forces a node to save the cluster configuration to disk.
  ///
  /// CLUSTER SAVECONFIG
  /// https://valkey.io/commands/cluster-saveconfig/
  @since(version = 0.3.0-dev)
  cluster-saveconfig: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Sets the configuration epoch for a new node.
  ///
  /// CLUSTER SET-CONFIG-EPOCH config-epoch
  /// https://valkey.io/commands/cluster-set-config-epoch/
  @since(version = 0.3.0-dev)
  cluster-set-config-epoch: async func(connection: borrow<connection>, config-epoch: integer) -> result<_, error-code>;

  /// Binds a hash slot to a node.
  ///
  /// CLUSTER SETSLOT slot 〈 IMPORTING node-id | MIGRATING node-id | NODE node-id | STABLE 〉 [ TIMEOUT timeout ]
  /// https://valkey.io/commands/cluster-setslot/
  @since(version = 0.3.0-dev)
  cluster-setslot: async func(connection: borrow<connection>, slot: u16, state: cluster-setslot-state, timeout: option<duration-milliseconds>) -> result<_, error-code>;

  /// Returns the specified command log's entries.
  ///
  /// COMMANDLOG GET count 〈 slow | large-request | large-reply 〉
  /// https://valkey.io/commands/commandlog-get/
  @since(version = 0.3.0-dev)
  commandlog-get: async func(connection: borrow<connection>, count: integer, %type: commandlog-type) -> result<list<commandlog-entry>, error-code>;

  /// Returns the number of entries in the specified type of command log.
  ///
  /// COMMANDLOG LEN 〈 slow | large-request | large-reply 〉
  /// https://valkey.io/commands/commandlog-len/
  @since(version = 0.3.0-dev)
  commandlog-len: async func(connection: borrow<connection>, %type: commandlog-type) -> result<integer, error-code>;

  /// Clears all entries from the specified type of command log.
  ///
  /// COMMANDLOG RESET 〈 slow | large-request | large-reply 〉
  /// https://valkey.io/commands/commandlog-reset/
  @since(version = 0.3.0-dev)
  commandlog-reset: async func(connection: borrow<connection>, %type: commandlog-type) -> result<_, error-code>;

  /// Returns the effective values of configuration parameters.
  ///
  /// CONFIG GET parameter [ parameter ... ]
  /// https://valkey.io/commands/config-get/
  @since(version = 0.3.0-dev)
  config-get: async func(connection: borrow<connection>, parameters: list<string>) -> result<map<string, string>, error-code>;

  /// Resets the server's statistics.
  ///
  /// CONFIG RESETSTAT
  /// https://valkey.io/commands/config-resetstat/
  @since(version = 0.3.0-dev)
  config-resetstat: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Persists the effective configuration to file.
  ///
  /// CONFIG REWRITE
  /// https://valkey.io/commands/config-rewrite/
  @since(version = 0.3.0-dev)
  config-rewrite: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Sets configuration parameters in-flight.
  ///
  /// CONFIG SET parameter value [ parameter value ... ]
  /// https://valkey.io/commands/config-set/
  @since(version = 0.3.0-dev)
  config-set: async func(connection: borrow<connection>, parameters-and-values: list<tuple<string, string>>) -> result<_, error-code>;

  /// Starts a coordinated failover from a server to one of its replicas.
  ///
  /// FAILOVER [ TO host port [ FORCE ] ] [ ABORT ] [ TIMEOUT milliseconds ]
  /// https://valkey.io/commands/failover/
  @since(version = 0.3.0-dev)
  failover: async func(connection: borrow<connection>, target: option<failover-target>, abort: bool, timeout: option<duration-milliseconds>) -> result<_, error-code>;

  /// Returns the Unix timestamp of the last successful save to disk.
  ///
  /// LASTSAVE
  /// https://valkey.io/commands/lastsave/
  @since(version = 0.3.0-dev)
  lastsave: async func(connection: borrow<connection>) -> result<unix-time-seconds, error-code>;

  /// Returns a human-readable latency analysis report.
  ///
  /// LATENCY DOCTOR
  /// https://valkey.io/commands/latency-doctor/
  @since(version = 0.3.0-dev)
  latency-doctor: async func(connection: borrow<connection>) -> result<string, error-code>;

  /// Returns a latency graph for an event.
  ///
  /// LATENCY GRAPH event
  /// https://valkey.io/commands/latency-graph/
  @since(version = 0.3.0-dev)
  latency-graph: async func(connection: borrow<connection>, event: string) -> result<string, error-code>;

  /// Returns the cumulative distribution of latencies of a subset or all commands.
  ///
  /// LATENCY HISTOGRAM [ command [ command ... ] ]
  /// https://valkey.io/commands/latency-histogram/
  @since(version = 0.3.0-dev)
  latency-histogram: async func(connection: borrow<connection>, commands: option<list<string>>) -> result<map<string, latency-histogram-entry>, error-code>;

  /// Returns timestamp-latency samples for an event.
  ///
  /// LATENCY HISTORY event
  /// https://valkey.io/commands/latency-history/
  @since(version = 0.3.0-dev)
  latency-history: async func(connection: borrow<connection>, event: string) -> result<list<tuple<unix-time-seconds, duration-milliseconds>>, error-code>;

  /// Returns the latest latency samples for all events.
  ///
  /// LATENCY LATEST
  /// https://valkey.io/commands/latency-latest/
  @since(version = 0.3.0-dev)
  latency-latest: async func(connection: borrow<connection>) -> result<list<latency-latest-entry>, error-code>;

  /// Resets the latency data for one or more events.
  ///
  /// LATENCY RESET [ event [ event ... ] ]
  /// https://valkey.io/commands/latency-reset/
  @since(version = 0.3.0-dev)
  latency-reset: async func(connection: borrow<connection>, events: option<list<string>>) -> result<integer, error-code>;

  /// Returns all loaded modules.
  ///
  /// MODULE LIST
  /// https://valkey.io/commands/module-list/
  @since(version = 0.3.0-dev)
  module-list: async func(connection: borrow<connection>) -> result<list<module-list-entry>, error-code>;

  /// Loads a module.
  ///
  /// MODULE LOAD path [ arg [ arg ... ] ]
  /// https://valkey.io/commands/module-load/
  @since(version = 0.3.0-dev)
  module-load: async func(connection: borrow<connection>, path: string, args: option<list<string>>) -> result<_, error-code>;

  /// Loads a module using extended parameters.
  ///
  /// MODULE LOADEX path [ CONFIG name value [ CONFIG name value ... ] ] [ ARGS args [ args ... ] ]
  /// https://valkey.io/commands/module-loadex/
  @since(version = 0.3.0-dev)
  module-loadex: async func(connection: borrow<connection>, path: string, configs: option<list<tuple<string, string>>>, args: option<list<string>>) -> result<_, error-code>;

  /// Unloads a module.
  ///
  /// MODULE UNLOAD name
  /// https://valkey.io/commands/module-unload/
  @since(version = 0.3.0-dev)
  module-unload: async func(connection: borrow<connection>, name: string) -> result<_, error-code>;

  /// Configures a server as replica of another, or promotes it to a primary.
  ///
  /// None makes the server a primary, `NO ONE`.
  ///
  /// REPLICAOF 〈 host port | NO ONE 〉
  /// https://valkey.io/commands/replicaof/
  @since(version = 0.3.0-dev)
  replicaof: async func(connection: borrow<connection>, primary: option<tuple<string, u16>>) -> result<string, error-code>;

  /// Returns the replication role.
  ///
  /// ROLE
  /// https://valkey.io/commands/role/
  @since(version = 0.3.0-dev)
  role: async func(connection: borrow<connection>) -> result<role-reply, error-code>;

  /// Synchronously saves the database(s) to disk.
  ///
  /// SAVE
  /// https://valkey.io/commands/save/
  @since(version = 0.3.0-dev)
  save: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Synchronously saves the database(s) to disk and shuts down the server.
  ///
  /// The server closes the connection once it stops, so a shutdown that succeeds fails the call
  /// with a closed error.
  ///
  /// See also `shutdown-abort`.
  ///
  /// SHUTDOWN [ NOSAVE | SAVE ] [ NOW ] [ FORCE ] [ SAFE ] [ FAILOVER ]
  /// https://valkey.io/commands/shutdown/
  @since(version = 0.3.0-dev)
  shutdown: async func(connection: borrow<connection>, save: option<shutdown-save>, modifiers: shutdown-flags) -> result<_, error-code>;

  /// Synchronously saves the database(s) to disk and shuts down the server.
  ///
  /// The `ABORT` form, aborting a shutdown in progress.
  ///
  /// See also `shutdown`.
  ///
  /// SHUTDOWN ABORT
  /// https://valkey.io/commands/shutdown/
  @since(version = 0.3.0-dev)
  shutdown-abort: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Returns the slow log's entries.
  ///
  /// SLOWLOG GET [ count ]
  /// https://valkey.io/commands/slowlog-get/
  @since(version = 0.3.0-dev)
  slowlog-get: async func(connection: borrow<connection>, count: option<integer>) -> result<list<slowlog-entry>, error-code>;

  /// Returns the number of entries in the slow log.
  ///
  /// SLOWLOG LEN
  /// https://valkey.io/commands/slowlog-len/
  @since(version = 0.3.0-dev)
  slowlog-len: async func(connection: borrow<connection>) -> result<integer, error-code>;

  /// Clears all entries from the slow log.
  ///
  /// SLOWLOG RESET
  /// https://valkey.io/commands/slowlog-reset/
  @since(version = 0.3.0-dev)
  slowlog-reset: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Counts the number of set bits (population counting) in a string.
  ///
  /// BITCOUNT key [ start [ end [ BYTE | BIT ] ] ]
  /// https://valkey.io/commands/bitcount/
  @since(version = 0.3.0-dev)
  bitcount: async func(connection: borrow<connection>, key: string, range: option<bit-range>) -> result<integer, error-code>;

  /// Performs arbitrary bitfield integer operations on strings.
  ///
  /// None for a write that failed with `OVERFLOW FAIL`.
  ///
  /// BITFIELD key [ GET encoding offset | [ OVERFLOW WRAP | SAT | FAIL ] 〈 SET encoding offset value | INCRBY encoding offset increment 〉 [ GET encoding offset | [ OVERFLOW WRAP | SAT | FAIL ] 〈 SET encoding offset value | INCRBY encoding offset increment 〉 ... ] ]
  /// https://valkey.io/commands/bitfield/
  @since(version = 0.3.0-dev)
  bitfield: async func(connection: borrow<connection>, key: string, operations: option<list<bitfield-operation>>) -> result<list<option<integer>>, error-code>;

  /// Performs arbitrary read-only bitfield integer operations on strings.
  ///
  /// BITFIELD_RO key [ GET encoding offset [ GET encoding offset ... ] ]
  /// https://valkey.io/commands/bitfield_ro/
  @since(version = 0.3.0-dev)
  bitfield-ro: async func(connection: borrow<connection>, key: string, gets: option<list<bitfield-ro-get>>) -> result<list<integer>, error-code>;

  /// Performs bitwise operations on multiple strings, and stores the result.
  ///
  /// BITOP 〈 AND | OR | XOR | NOT 〉 destkey key [ key ... ]
  /// https://valkey.io/commands/bitop/
  @since(version = 0.3.0-dev)
  bitop: async func(connection: borrow<connection>, destination: string, operation: bitop-operation) -> result<integer, error-code>;

  /// Finds the first set (1) or clear (0) bit in a string.
  ///
  /// None when no bit matches, the server's `-1`.
  ///
  /// BITPOS key bit [ start [ end [ BYTE | BIT ] ] ]
  /// https://valkey.io/commands/bitpos/
  @since(version = 0.3.0-dev)
  bitpos: async func(connection: borrow<connection>, key: string, bit: bool, range: option<bit-range>) -> result<option<integer>, error-code>;

  /// Returns a bit value by offset.
  ///
  /// GETBIT key offset
  /// https://valkey.io/commands/getbit/
  @since(version = 0.3.0-dev)
  getbit: async func(connection: borrow<connection>, key: string, offset: u64) -> result<bool, error-code>;

  /// Sets or clears the bit at offset of the string value.
  ///
  /// SETBIT key offset value
  /// https://valkey.io/commands/setbit/
  @since(version = 0.3.0-dev)
  setbit: async func(connection: borrow<connection>, key: string, offset: u64, value: bool) -> result<bool, error-code>;

  /// Signals that a cluster client is following an -ASK redirect.
  ///
  /// It applies to the next command on the connection, which may be another caller's when the
  /// connection is shared. Use a connection of your own.
  ///
  /// ASKING
  /// https://valkey.io/commands/asking/
  @since(version = 0.3.0-dev)
  asking: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Authenticates the connection.
  ///
  /// AUTH [ username ] password
  /// https://valkey.io/commands/auth/
  @since(version = 0.3.0-dev)
  auth: async func(connection: borrow<connection>, username: option<string>, password: string) -> result<_, error-code>;

  /// Instructs the server whether to track the keys in the next request.
  ///
  /// It applies to the next command on the connection, which may be another caller's when the
  /// connection is shared. Use a connection of your own.
  ///
  /// CLIENT CACHING 〈 YES | NO 〉
  /// https://valkey.io/commands/client-caching/
  @since(version = 0.3.0-dev)
  client-caching: async func(connection: borrow<connection>, enabled: bool) -> result<_, error-code>;

  /// A client claims its capability.
  ///
  /// CLIENT CAPA capability [ capability ... ]
  /// https://valkey.io/commands/client-capa/
  @since(version = 0.3.0-dev)
  client-capa: async func(connection: borrow<connection>, capabilities: list<string>) -> result<_, error-code>;

  /// Returns the name of the connection.
  ///
  /// CLIENT GETNAME
  /// https://valkey.io/commands/client-getname/
  @since(version = 0.3.0-dev)
  client-getname: async func(connection: borrow<connection>) -> result<option<string>, error-code>;

  /// Returns the unique client ID of the connection.
  ///
  /// CLIENT ID
  /// https://valkey.io/commands/client-id/
  @since(version = 0.3.0-dev)
  client-id: async func(connection: borrow<connection>) -> result<integer, error-code>;

  /// Marks this client as an import source when the server is in import mode.
  ///
  /// CLIENT IMPORT-SOURCE 〈 ON | OFF 〉
  /// https://valkey.io/commands/client-import-source/
  @since(version = 0.3.0-dev)
  client-import-source: async func(connection: borrow<connection>, enabled: bool) -> result<_, error-code>;

  /// Returns information about the connection.
  ///
  /// A map of the fields, parsed from the server's text, e.g. `id`, `addr` and `name`.
  ///
  /// CLIENT INFO
  /// https://valkey.io/commands/client-info/
  @since(version = 0.3.0-dev)
  client-info: async func(connection: borrow<connection>) -> result<map<string, string>, error-code>;

  /// Controls whether commands sent by the client affect the LRU/LFU of accessed keys.
  ///
  /// It applies to the connection, so to every caller sharing it.
  ///
  /// CLIENT NO-TOUCH 〈 ON | OFF 〉
  /// https://valkey.io/commands/client-no-touch/
  @since(version = 0.3.0-dev)
  client-no-touch: async func(connection: borrow<connection>, enabled: bool) -> result<_, error-code>;

  /// Sets information specific to the client or connection.
  ///
  /// CLIENT SETINFO 〈 LIB-NAME libname | LIB-VER libver 〉
  /// https://valkey.io/commands/client-setinfo/
  @since(version = 0.3.0-dev)
  client-setinfo: async func(connection: borrow<connection>, attr: client-setinfo-attr) -> result<_, error-code>;

  /// Sets the connection name.
  ///
  /// CLIENT SETNAME connection-name
  /// https://valkey.io/commands/client-setname/
  @since(version = 0.3.0-dev)
  client-setname: async func(connection: borrow<connection>, connection-name: string) -> result<_, error-code>;

  /// Controls server-assisted client-side caching for the connection.
  ///
  /// Invalidations arrive as push messages, see `connection.dead-letters`. It applies to the
  /// connection, so to every caller sharing it.
  ///
  /// CLIENT TRACKING 〈 ON | OFF 〉 [ PREFIX prefix [ PREFIX prefix ... ] ] [ BCAST ] [ OPTIN ] [ OPTOUT ] [ NOLOOP ]
  /// https://valkey.io/commands/client-tracking/
  @since(version = 0.3.0-dev)
  client-tracking: async func(connection: borrow<connection>, options: option<client-tracking-options>) -> result<_, error-code>;

  /// Returns information about server-assisted client-side caching for the connection.
  ///
  /// CLIENT TRACKINGINFO
  /// https://valkey.io/commands/client-trackinginfo/
  @since(version = 0.3.0-dev)
  client-trackinginfo: async func(connection: borrow<connection>) -> result<client-trackinginfo-reply, error-code>;

  /// Returns detailed information about all commands.
  ///
  /// COMMAND
  /// https://valkey.io/commands/command/
  @since(version = 0.3.0-dev)
  command: async func(connection: borrow<connection>) -> result<list<command-reply>, error-code>;

  /// Returns a count of commands.
  ///
  /// COMMAND COUNT
  /// https://valkey.io/commands/command-count/
  @since(version = 0.3.0-dev)
  command-count: async func(connection: borrow<connection>) -> result<integer, error-code>;

  /// Returns documentary information about one, multiple or all commands.
  ///
  /// A container is followed by its subcommands. Commands that do not exist are left out.
  ///
  /// COMMAND DOCS [ command-name [ command-name ... ] ]
  /// https://valkey.io/commands/command-docs/
  @since(version = 0.3.0-dev)
  command-docs: async func(connection: borrow<connection>, command-names: option<list<string>>) -> result<list<command-docs-reply>, error-code>;

  /// Extracts the key names from an arbitrary command.
  ///
  /// COMMAND GETKEYS command [ arg [ arg ... ] ]
  /// https://valkey.io/commands/command-getkeys/
  @since(version = 0.3.0-dev)
  command-getkeys: async func(connection: borrow<connection>, command: list<string>) -> result<list<string>, error-code>;

  /// Extracts the key names and access flags for an arbitrary command.
  ///
  /// COMMAND GETKEYSANDFLAGS command [ arg [ arg ... ] ]
  /// https://valkey.io/commands/command-getkeysandflags/
  @since(version = 0.3.0-dev)
  command-getkeysandflags: async func(connection: borrow<connection>, command: list<string>) -> result<list<tuple<string, list<string>>>, error-code>;

  /// Returns information about one, multiple or all commands.
  ///
  /// A container is followed by its subcommands. Commands that do not exist are left out.
  ///
  /// COMMAND INFO [ command-name [ command-name ... ] ]
  /// https://valkey.io/commands/command-info/
  @since(version = 0.3.0-dev)
  command-info: async func(connection: borrow<connection>, command-names: option<list<string>>) -> result<list<command-info-reply>, error-code>;

  /// Returns a list of command names.
  ///
  /// COMMAND LIST [ FILTERBY 〈 MODULE module-name | ACLCAT category | PATTERN pattern 〉 ]
  /// https://valkey.io/commands/command-list/
  @since(version = 0.3.0-dev)
  command-list: async func(connection: borrow<connection>, filter: option<command-list-filter>) -> result<list<string>, error-code>;

  /// Returns the given string.
  ///
  /// ECHO message
  /// https://valkey.io/commands/echo/
  @since(version = 0.3.0-dev)
  echo: async func(connection: borrow<connection>, message: string-or-bytes) -> result<string-or-bytes, error-code>;

  /// Returns the server's liveliness response.
  ///
  /// PING [ message ]
  /// https://valkey.io/commands/ping/
  @since(version = 0.3.0-dev)
  ping: async func(connection: borrow<connection>, message: option<string-or-bytes>) -> result<_, error-code>;

  /// Enables read-only queries for a connection to a Valkey replica node.
  ///
  /// It applies to the connection, so to every caller sharing it.
  ///
  /// READONLY
  /// https://valkey.io/commands/readonly/
  @since(version = 0.3.0-dev)
  readonly: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Enables read-write queries for a connection to a Valkey replica node.
  ///
  /// It applies to the connection, so to every caller sharing it.
  ///
  /// READWRITE
  /// https://valkey.io/commands/readwrite/
  @since(version = 0.3.0-dev)
  readwrite: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Changes the selected database.
  ///
  /// It applies to the connection, so to every caller sharing it.
  ///
  /// SELECT index
  /// https://valkey.io/commands/select/
  @since(version = 0.3.0-dev)
  select: async func(connection: borrow<connection>, index: integer) -> result<_, error-code>;

  /// Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.
  ///
  /// The connection waits too, replies to commands sent after it on the connection wait behind
  /// it. Use a connection of your own.
  ///
  /// WAIT numreplicas timeout
  /// https://valkey.io/commands/wait/
  @since(version = 0.3.0-dev)
  wait: async func(connection: borrow<connection>, numreplicas: integer, timeout: duration-milliseconds) -> result<integer, error-code>;

  /// Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the primary and/or replicas.
  ///
  /// The connection waits too, replies to commands sent after it on the connection wait behind
  /// it. Use a connection of your own.
  ///
  /// WAITAOF numlocal numreplicas timeout
  /// https://valkey.io/commands/waitaof/
  @since(version = 0.3.0-dev)
  waitaof: async func(connection: borrow<connection>, numlocal: integer, numreplicas: integer, timeout: duration-milliseconds) -> result<tuple<integer, integer>, error-code>;

  /// Adds one or more members to a geospatial index.
  ///
  /// GEOADD key [ NX | XX ] [ CH ] longitude latitude member [ longitude latitude member ... ]
  /// https://valkey.io/commands/geoadd/
  @since(version = 0.3.0-dev)
  geoadd: async func(connection: borrow<connection>, key: string, condition: option<geoadd-condition>, changed: bool, coordinates-and-members: list<tuple<geo-coordinates, string-or-bytes>>) -> result<integer, error-code>;

  /// Returns the distance between two members of a geospatial index.
  ///
  /// GEODIST key member1 member2 [ m | km | ft | mi ]
  /// https://valkey.io/commands/geodist/
  @since(version = 0.3.0-dev)
  geodist: async func(connection: borrow<connection>, key: string, member1: string-or-bytes, member2: string-or-bytes, unit: option<geo-unit>) -> result<option<double>, error-code>;

  /// Returns members from a geospatial index as geohash strings.
  ///
  /// GEOHASH key [ member [ member ... ] ]
  /// https://valkey.io/commands/geohash/
  @since(version = 0.3.0-dev)
  geohash: async func(connection: borrow<connection>, key: string, members: option<list<string-or-bytes>>) -> result<list<option<string>>, error-code>;

  /// Returns the longitude and latitude of members from a geospatial index.
  ///
  /// GEOPOS key [ member [ member ... ] ]
  /// https://valkey.io/commands/geopos/
  @since(version = 0.3.0-dev)
  geopos: async func(connection: borrow<connection>, key: string, members: option<list<string-or-bytes>>) -> result<list<option<geo-coordinates>>, error-code>;

  /// Queries a geospatial index for members inside an area of a box, circle, or a polygon.
  ///
  /// See also `geosearch-with`.
  ///
  /// GEOSEARCH key [ FROMMEMBER member | FROMLONLAT longitude latitude ] 〈 BYRADIUS radius 〈 m | km | ft | mi 〉 | BYBOX width height 〈 m | km | ft | mi 〉 | BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ] 〉 [ ASC | DESC ] [ COUNT count [ ANY ] ]
  /// https://valkey.io/commands/geosearch/
  @since(version = 0.3.0-dev)
  geosearch: async func(connection: borrow<connection>, key: string, shape: geosearch-shape, order: option<sort-order>, count: option<geosearch-count>) -> result<list<string-or-bytes>, error-code>;

  /// Queries a geospatial index for members inside an area of a box, circle, or a polygon.
  ///
  /// Returns each member with the details asked for, `WITHCOORD`, `WITHDIST` and `WITHHASH`.
  ///
  /// See also `geosearch`.
  ///
  /// GEOSEARCH key [ FROMMEMBER member | FROMLONLAT longitude latitude ] 〈 BYRADIUS radius 〈 m | km | ft | mi 〉 | BYBOX width height 〈 m | km | ft | mi 〉 | BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ] 〉 [ ASC | DESC ] [ COUNT count [ ANY ] ] [ WITHCOORD ] [ WITHDIST ] [ WITHHASH ]
  /// https://valkey.io/commands/geosearch/
  @since(version = 0.3.0-dev)
  geosearch-with: async func(connection: borrow<connection>, key: string, shape: geosearch-shape, order: option<sort-order>, count: option<geosearch-count>, details: geosearch-with-flags) -> result<list<geosearch-with-result>, error-code>;

  /// Queries a geospatial index for members inside an area of a box, a circle, or a polygon, optionally stores the result.
  ///
  /// GEOSEARCHSTORE destination source [ FROMMEMBER member | FROMLONLAT longitude latitude ] 〈 BYRADIUS radius 〈 m | km | ft | mi 〉 | BYBOX width height 〈 m | km | ft | mi 〉 | BYPOLYGON num-vertices longitude latitude [ longitude latitude ... ] 〉 [ ASC | DESC ] [ COUNT count [ ANY ] ] [ STOREDIST ]
  /// https://valkey.io/commands/geosearchstore/
  @since(version = 0.3.0-dev)
  geosearchstore: async func(connection: borrow<connection>, destination: string, source: string, shape: geosearchstore-shape, order: option<sort-order>, count: option<geosearchstore-count>, storedist: bool) -> result<integer, error-code>;

  /// Deletes one or more fields and their values from a hash.
  ///
  /// HDEL key field [ field ... ]
  /// https://valkey.io/commands/hdel/
  @since(version = 0.3.0-dev)
  hdel: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<integer, error-code>;

  /// Determines whether a field exists in a hash.
  ///
  /// HEXISTS key field
  /// https://valkey.io/commands/hexists/
  @since(version = 0.3.0-dev)
  hexists: async func(connection: borrow<connection>, key: string, field: string) -> result<bool, error-code>;

  /// Sets the expiration time of one or more hash fields in seconds.
  ///
  /// HEXPIRE key seconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hexpire/
  @since(version = 0.3.0-dev)
  hexpire: async func(connection: borrow<connection>, key: string, seconds: duration-seconds, mode: option<ttl-mode>, fields: list<string>) -> result<list<hexpire-result>, error-code>;

  /// Sets the expiration time of one or more hash fields to a Unix timestamp.
  ///
  /// HEXPIREAT key unix-time-seconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hexpireat/
  @since(version = 0.3.0-dev)
  hexpireat: async func(connection: borrow<connection>, key: string, seconds: unix-time-seconds, mode: option<ttl-mode>, fields: list<string>) -> result<list<hexpireat-result>, error-code>;

  /// Returns Unix timestamps in seconds since the epoch at which the given key's field(s) will expire.
  ///
  /// HEXPIRETIME key FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hexpiretime/
  @since(version = 0.3.0-dev)
  hexpiretime: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<hexpiretime-reply>, error-code>;

  /// Returns the value of a field in a hash.
  ///
  /// HGET key field
  /// https://valkey.io/commands/hget/
  @since(version = 0.3.0-dev)
  hget: async func(connection: borrow<connection>, key: string, field: string) -> result<option<string-or-bytes>, error-code>;

  /// Returns all fields and values in a hash.
  ///
  /// HGETALL key
  /// https://valkey.io/commands/hgetall/
  @since(version = 0.3.0-dev)
  hgetall: async func(connection: borrow<connection>, key: string) -> result<map<string, string-or-bytes>, error-code>;

  /// Returns the values of one or more fields and deletes them from a hash.
  ///
  /// HGETDEL key FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hgetdel/
  @since(version = 0.3.0-dev)
  hgetdel: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<option<string-or-bytes>>, error-code>;

  /// Gets the value of one or more fields of a given hash key, and optionally sets their expiration time or time-to-live (TTL).
  ///
  /// HGETEX key [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST ] FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hgetex/
  @since(version = 0.3.0-dev)
  hgetex: async func(connection: borrow<connection>, key: string, ttl: option<hgetex-ttl>, fields: list<string>) -> result<list<option<string-or-bytes>>, error-code>;

  /// Increments the integer value of a field in a hash by a number.
  ///
  /// HINCRBY key field increment
  /// https://valkey.io/commands/hincrby/
  @since(version = 0.3.0-dev)
  hincrby: async func(connection: borrow<connection>, key: string, field: string, increment: integer) -> result<integer, error-code>;

  /// Increments the floating point value of a field by a number.
  ///
  /// HINCRBYFLOAT key field increment
  /// https://valkey.io/commands/hincrbyfloat/
  @since(version = 0.3.0-dev)
  hincrbyfloat: async func(connection: borrow<connection>, key: string, field: string, increment: double) -> result<double, error-code>;

  /// Returns all fields in a hash.
  ///
  /// HKEYS key
  /// https://valkey.io/commands/hkeys/
  @since(version = 0.3.0-dev)
  hkeys: async func(connection: borrow<connection>, key: string) -> result<list<string>, error-code>;

  /// Returns the number of fields in a hash.
  ///
  /// HLEN key
  /// https://valkey.io/commands/hlen/
  @since(version = 0.3.0-dev)
  hlen: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Returns the values of all fields in a hash.
  ///
  /// HMGET key field [ field ... ]
  /// https://valkey.io/commands/hmget/
  @since(version = 0.3.0-dev)
  hmget: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<option<string-or-bytes>>, error-code>;

  /// Sets the values of multiple fields.
  ///
  /// HMSET key field value [ field value ... ]
  /// https://valkey.io/commands/hmset/
  @since(version = 0.3.0-dev)
  hmset: async func(connection: borrow<connection>, key: string, field-and-values: list<tuple<string, string-or-bytes>>) -> result<_, error-code>;

  /// Remove the existing expiration on a hash key's field(s).
  ///
  /// HPERSIST key FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hpersist/
  @since(version = 0.3.0-dev)
  hpersist: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<hpersist-result>, error-code>;

  /// Sets the expiration time of one or more hash fields in milliseconds.
  ///
  /// HPEXPIRE key milliseconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hpexpire/
  @since(version = 0.3.0-dev)
  hpexpire: async func(connection: borrow<connection>, key: string, milliseconds: duration-milliseconds, mode: option<ttl-mode>, fields: list<string>) -> result<list<hpexpire-result>, error-code>;

  /// Sets the expiration time of one or more hash fields to a Unix timestamp in milliseconds.
  ///
  /// HPEXPIREAT key unix-time-milliseconds [ NX | XX | GT | LT ] FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hpexpireat/
  @since(version = 0.3.0-dev)
  hpexpireat: async func(connection: borrow<connection>, key: string, milliseconds: unix-time-milliseconds, mode: option<ttl-mode>, fields: list<string>) -> result<list<hpexpireat-result>, error-code>;

  /// Returns the Unix timestamp in milliseconds since Unix epoch at which the given key's field(s) will expire.
  ///
  /// HPEXPIRETIME key FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hpexpiretime/
  @since(version = 0.3.0-dev)
  hpexpiretime: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<hpexpiretime-reply>, error-code>;

  /// Returns the remaining time to live in milliseconds of a hash key's field(s) that have an associated expiration.
  ///
  /// HPTTL key FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/hpttl/
  @since(version = 0.3.0-dev)
  hpttl: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<hpttl-reply>, error-code>;

  /// Returns one or more random fields from a hash.
  ///
  /// Without a count, at most one field.
  ///
  /// See also `hrandfield-withvalues`.
  ///
  /// HRANDFIELD key [ count ]
  /// https://valkey.io/commands/hrandfield/
  @since(version = 0.3.0-dev)
  hrandfield: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<string>, error-code>;

  /// Returns one or more random fields from a hash.
  ///
  /// The `WITHVALUES` form, the fields and their values.
  ///
  /// See also `hrandfield`.
  ///
  /// HRANDFIELD key count WITHVALUES
  /// https://valkey.io/commands/hrandfield/
  @since(version = 0.3.0-dev)
  hrandfield-withvalues: async func(connection: borrow<connection>, key: string, count: integer) -> result<list<tuple<string, string-or-bytes>>, error-code>;

  /// Iterates over fields and values of a hash.
  ///
  /// See also `hscan-novalues`.
  ///
  /// HSCAN key cursor [ MATCH pattern ] [ COUNT count ]
  /// https://valkey.io/commands/hscan/
  @since(version = 0.3.0-dev)
  hscan: async func(connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>) -> result<tuple<option<cursor>, map<string, string-or-bytes>>, error-code>;

  /// Iterates over fields and values of a hash.
  ///
  /// The `NOVALUES` form, the fields only.
  ///
  /// See also `hscan`.
  ///
  /// HSCAN key cursor [ MATCH pattern ] [ COUNT count ] NOVALUES
  /// https://valkey.io/commands/hscan/
  @since(version = 0.3.0-dev)
  hscan-novalues: async func(connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>) -> result<tuple<option<cursor>, list<string>>, error-code>;

  /// Creates or modifies the value of a field in a hash.
  ///
  /// HSET key field value [ field value ... ]
  /// https://valkey.io/commands/hset/
  @since(version = 0.3.0-dev)
  hset: async func(connection: borrow<connection>, key: string, field-and-values: list<tuple<string, string-or-bytes>>) -> result<integer, error-code>;

  /// Sets the value of one or more fields of a given hash key, and optionally sets their expiration time.
  ///
  /// HSETEX key [ NX | XX ] [ FNX | FXX ] [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ] FIELDS numfields field value [ field value ... ]
  /// https://valkey.io/commands/hsetex/
  @since(version = 0.3.0-dev)
  hsetex: async func(connection: borrow<connection>, key: string, condition: option<hsetex-condition>, field-condition: option<hsetex-field-condition>, ttl: option<hsetex-ttl>, field-and-values: list<tuple<string, string-or-bytes>>) -> result<bool, error-code>;

  /// Sets the value of a field in a hash only when the field doesn't exist.
  ///
  /// HSETNX key field value
  /// https://valkey.io/commands/hsetnx/
  @since(version = 0.3.0-dev)
  hsetnx: async func(connection: borrow<connection>, key: string, field: string, value: string-or-bytes) -> result<bool, error-code>;

  /// Returns the length of the value of a field.
  ///
  /// HSTRLEN key field
  /// https://valkey.io/commands/hstrlen/
  @since(version = 0.3.0-dev)
  hstrlen: async func(connection: borrow<connection>, key: string, field: string) -> result<integer, error-code>;

  /// Returns the remaining time to live (in seconds) of a hash key's field(s) that have an associated expiration.
  ///
  /// HTTL key FIELDS numfields field [ field ... ]
  /// https://valkey.io/commands/httl/
  @since(version = 0.3.0-dev)
  httl: async func(connection: borrow<connection>, key: string, fields: list<string>) -> result<list<httl-reply>, error-code>;

  /// Returns all values in a hash.
  ///
  /// HVALS key
  /// https://valkey.io/commands/hvals/
  @since(version = 0.3.0-dev)
  hvals: async func(connection: borrow<connection>, key: string) -> result<list<string-or-bytes>, error-code>;

  /// Adds elements to a HyperLogLog key.
  ///
  /// PFADD key [ element [ element ... ] ]
  /// https://valkey.io/commands/pfadd/
  @since(version = 0.3.0-dev)
  pfadd: async func(connection: borrow<connection>, key: string, elements: option<list<string-or-bytes>>) -> result<bool, error-code>;

  /// Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s).
  ///
  /// PFCOUNT key [ key ... ]
  /// https://valkey.io/commands/pfcount/
  @since(version = 0.3.0-dev)
  pfcount: async func(connection: borrow<connection>, keys: list<string>) -> result<integer, error-code>;

  /// Merges one or more HyperLogLog values into a single key.
  ///
  /// PFMERGE destkey [ sourcekey [ sourcekey ... ] ]
  /// https://valkey.io/commands/pfmerge/
  @since(version = 0.3.0-dev)
  pfmerge: async func(connection: borrow<connection>, destination: string, sources: option<list<string>>) -> result<_, error-code>;

  /// Removes all keys from the target slot.
  ///
  /// CLUSTER FLUSHSLOT slot [ ASYNC | SYNC ]
  /// https://valkey.io/commands/cluster-flushslot/
  @since(version = 0.3.0-dev)
  cluster-flushslot: async func(connection: borrow<connection>, slot: u16, mode: option<flush-mode>) -> result<_, error-code>;

  /// Iterates over the keys in the cluster.
  ///
  /// The cursor carries the slot, for clients to route each call to the node that owns it.
  ///
  /// CLUSTERSCAN cursor [ MATCH match-pattern ] [ COUNT count ] [ TYPE type ] [ SLOT slot ]
  /// https://valkey.io/commands/clusterscan/
  @since(version = 0.3.0-dev)
  clusterscan: async func(connection: borrow<connection>, cursor: cursor, match: option<string>, count: option<integer>, %type: option<key-type>, slot: option<u16>) -> result<tuple<option<cursor>, list<string>>, error-code>;

  /// Copies the value of a key to a new key.
  ///
  /// COPY source destination [ DB destination-db ] [ REPLACE ]
  /// https://valkey.io/commands/copy/
  @since(version = 0.3.0-dev)
  copy: async func(connection: borrow<connection>, source: string, destination: string, destination-db: option<integer>, replace: bool) -> result<bool, error-code>;

  /// Returns the number of keys in the database.
  ///
  /// DBSIZE
  /// https://valkey.io/commands/dbsize/
  @since(version = 0.3.0-dev)
  dbsize: async func(connection: borrow<connection>) -> result<integer, error-code>;

  /// Deletes one or more keys.
  ///
  /// DEL key [ key ... ]
  /// https://valkey.io/commands/del/
  @since(version = 0.3.0-dev)
  del: async func(connection: borrow<connection>, keys: list<string>) -> result<integer, error-code>;

  /// Returns a serialized representation of the value stored at a key.
  ///
  /// DUMP key
  /// https://valkey.io/commands/dump/
  @since(version = 0.3.0-dev)
  dump: async func(connection: borrow<connection>, key: string) -> result<option<bytes>, error-code>;

  /// Determines whether one or more keys exist.
  ///
  /// EXISTS key [ key ... ]
  /// https://valkey.io/commands/exists/
  @since(version = 0.3.0-dev)
  exists: async func(connection: borrow<connection>, keys: list<string>) -> result<integer, error-code>;

  /// Sets the expiration time of a key in seconds.
  ///
  /// EXPIRE key seconds [ NX | XX | GT | LT ]
  /// https://valkey.io/commands/expire/
  @since(version = 0.3.0-dev)
  expire: async func(connection: borrow<connection>, key: string, seconds: duration-seconds, mode: option<ttl-mode>) -> result<bool, error-code>;

  /// Sets the expiration time of a key to a Unix timestamp.
  ///
  /// EXPIREAT key unix-time-seconds [ NX | XX | GT | LT ]
  /// https://valkey.io/commands/expireat/
  @since(version = 0.3.0-dev)
  expireat: async func(connection: borrow<connection>, key: string, seconds: unix-time-seconds, mode: option<ttl-mode>) -> result<bool, error-code>;

  /// Returns the expiration time of a key as a Unix timestamp.
  ///
  /// EXPIRETIME key
  /// https://valkey.io/commands/expiretime/
  @since(version = 0.3.0-dev)
  expiretime: async func(connection: borrow<connection>, key: string) -> result<expiretime-reply, error-code>;

  /// Removes all keys from all databases.
  ///
  /// FLUSHALL [ ASYNC | SYNC ]
  /// https://valkey.io/commands/flushall/
  @since(version = 0.3.0-dev)
  flushall: async func(connection: borrow<connection>, mode: option<flush-mode>) -> result<_, error-code>;

  /// Removes all keys from the current database.
  ///
  /// FLUSHDB [ ASYNC | SYNC ]
  /// https://valkey.io/commands/flushdb/
  @since(version = 0.3.0-dev)
  flushdb: async func(connection: borrow<connection>, mode: option<flush-mode>) -> result<_, error-code>;

  /// Returns all key names that match a pattern.
  ///
  /// KEYS pattern
  /// https://valkey.io/commands/keys/
  @since(version = 0.3.0-dev)
  keys: async func(connection: borrow<connection>, pattern: string) -> result<list<string>, error-code>;

  /// Atomically transfers a key from one instance to another.
  ///
  /// False when none of the keys exist, the server's `NOKEY`.
  ///
  /// MIGRATE host port "" destination-db timeout [ COPY ] [ REPLACE ] [ AUTH password | AUTH2 username password ] KEYS key [ key ... ]
  /// https://valkey.io/commands/migrate/
  @since(version = 0.3.0-dev)
  migrate: async func(connection: borrow<connection>, host: string, port: u16, destination-db: integer, timeout: duration-milliseconds, options: migrate-flags, auth: option<migrate-auth>, keys: list<string>) -> result<bool, error-code>;

  /// Moves a key to another database.
  ///
  /// MOVE key db [ REPLACE ]
  /// https://valkey.io/commands/move/
  @since(version = 0.3.0-dev)
  move: async func(connection: borrow<connection>, key: string, db: integer, replace: bool) -> result<bool, error-code>;

  /// Returns the internal encoding of an object.
  ///
  /// OBJECT ENCODING key
  /// https://valkey.io/commands/object-encoding/
  @since(version = 0.3.0-dev)
  object-encoding: async func(connection: borrow<connection>, key: string) -> result<option<string>, error-code>;

  /// Returns the logarithmic access frequency counter of an object.
  ///
  /// OBJECT FREQ key
  /// https://valkey.io/commands/object-freq/
  @since(version = 0.3.0-dev)
  object-freq: async func(connection: borrow<connection>, key: string) -> result<option<integer>, error-code>;

  /// Returns the time since the last access to an object.
  ///
  /// OBJECT IDLETIME key
  /// https://valkey.io/commands/object-idletime/
  @since(version = 0.3.0-dev)
  object-idletime: async func(connection: borrow<connection>, key: string) -> result<option<duration-seconds>, error-code>;

  /// Returns the reference count of a value of a key.
  ///
  /// OBJECT REFCOUNT key
  /// https://valkey.io/commands/object-refcount/
  @since(version = 0.3.0-dev)
  object-refcount: async func(connection: borrow<connection>, key: string) -> result<option<integer>, error-code>;

  /// Removes the expiration time of a key.
  ///
  /// PERSIST key
  /// https://valkey.io/commands/persist/
  @since(version = 0.3.0-dev)
  persist: async func(connection: borrow<connection>, key: string) -> result<bool, error-code>;

  /// Sets the expiration time of a key in milliseconds.
  ///
  /// PEXPIRE key milliseconds [ NX | XX | GT | LT ]
  /// https://valkey.io/commands/pexpire/
  @since(version = 0.3.0-dev)
  pexpire: async func(connection: borrow<connection>, key: string, milliseconds: duration-milliseconds, mode: option<ttl-mode>) -> result<bool, error-code>;

  /// Sets the expiration time of a key to a Unix milliseconds timestamp.
  ///
  /// PEXPIREAT key unix-time-milliseconds [ NX | XX | GT | LT ]
  /// https://valkey.io/commands/pexpireat/
  @since(version = 0.3.0-dev)
  pexpireat: async func(connection: borrow<connection>, key: string, milliseconds: unix-time-milliseconds, mode: option<ttl-mode>) -> result<bool, error-code>;

  /// Returns the expiration time of a key as a Unix milliseconds timestamp.
  ///
  /// PEXPIRETIME key
  /// https://valkey.io/commands/pexpiretime/
  @since(version = 0.3.0-dev)
  pexpiretime: async func(connection: borrow<connection>, key: string) -> result<pexpiretime-reply, error-code>;

  /// Returns the expiration time in milliseconds of a key.
  ///
  /// PTTL key
  /// https://valkey.io/commands/pttl/
  @since(version = 0.3.0-dev)
  pttl: async func(connection: borrow<connection>, key: string) -> result<pttl-reply, error-code>;

  /// Returns a random key name from the database.
  ///
  /// RANDOMKEY
  /// https://valkey.io/commands/randomkey/
  @since(version = 0.3.0-dev)
  randomkey: async func(connection: borrow<connection>) -> result<option<string>, error-code>;

  /// Renames a key and overwrites the destination.
  ///
  /// RENAME key newkey
  /// https://valkey.io/commands/rename/
  @since(version = 0.3.0-dev)
  rename: async func(connection: borrow<connection>, key: string, newkey: string) -> result<_, error-code>;

  /// Renames a key only when the target key name doesn't exist.
  ///
  /// RENAMENX key newkey
  /// https://valkey.io/commands/renamenx/
  @since(version = 0.3.0-dev)
  renamenx: async func(connection: borrow<connection>, key: string, newkey: string) -> result<bool, error-code>;

  /// Creates a key from the serialized representation of a value.
  ///
  /// A `ttl` of none restores the key without an expiration, `0`, `expire-at` adds `ABSTTL`.
  ///
  /// RESTORE key ttl serialized-value [ REPLACE ] [ ABSTTL ] [ IDLETIME seconds ] [ FREQ frequency ]
  /// https://valkey.io/commands/restore/
  @since(version = 0.3.0-dev)
  restore: async func(connection: borrow<connection>, key: string, ttl: option<restore-ttl>, serialized-value: bytes, replace: bool, idletime: option<duration-seconds>, freq: option<integer>) -> result<_, error-code>;

  /// An internal command for migrating keys in a cluster.
  ///
  /// A `ttl` of none restores the key without an expiration, `0`, `expire-at` adds `ABSTTL`.
  ///
  /// RESTORE-ASKING key ttl serialized-value [ REPLACE ] [ ABSTTL ] [ IDLETIME seconds ] [ FREQ frequency ]
  /// https://valkey.io/commands/restore-asking/
  @since(version = 0.3.0-dev)
  restore-asking: async func(connection: borrow<connection>, key: string, ttl: option<restore-ttl>, serialized-value: bytes, replace: bool, idletime: option<duration-seconds>, freq: option<integer>) -> result<_, error-code>;

  /// Iterates over the key names in the database.
  ///
  /// SCAN cursor [ MATCH pattern ] [ COUNT count ] [ TYPE type ]
  /// https://valkey.io/commands/scan/
  @since(version = 0.3.0-dev)
  scan: async func(connection: borrow<connection>, cursor: cursor, match: option<string>, count: option<integer>, %type: option<key-type>) -> result<tuple<option<cursor>, list<string>>, error-code>;

  /// Swaps two databases.
  ///
  /// SWAPDB index1 index2
  /// https://valkey.io/commands/swapdb/
  @since(version = 0.3.0-dev)
  swapdb: async func(connection: borrow<connection>, index1: integer, index2: integer) -> result<_, error-code>;

  /// Returns the number of existing keys out of those specified after updating the time they were last accessed.
  ///
  /// TOUCH key [ key ... ]
  /// https://valkey.io/commands/touch/
  @since(version = 0.3.0-dev)
  touch: async func(connection: borrow<connection>, keys: list<string>) -> result<integer, error-code>;

  /// Returns the expiration time in seconds of a key.
  ///
  /// TTL key
  /// https://valkey.io/commands/ttl/
  @since(version = 0.3.0-dev)
  ttl: async func(connection: borrow<connection>, key: string) -> result<ttl-reply, error-code>;

  /// Determines the type of value stored at a key.
  ///
  /// None when the key does not exist, the server's `none`.
  ///
  /// TYPE key
  /// https://valkey.io/commands/type/
  @since(version = 0.3.0-dev)
  %type: async func(connection: borrow<connection>, key: string) -> result<option<key-type>, error-code>;

  /// Asynchronously deletes one or more keys.
  ///
  /// UNLINK key [ key ... ]
  /// https://valkey.io/commands/unlink/
  @since(version = 0.3.0-dev)
  unlink: async func(connection: borrow<connection>, keys: list<string>) -> result<integer, error-code>;

  /// Pops an element from a list, pushes it to another list and returns it.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BLMOVE source destination 〈 LEFT | RIGHT 〉 〈 LEFT | RIGHT 〉 timeout
  /// https://valkey.io/commands/blmove/
  @since(version = 0.3.0-dev)
  blmove: async func(connection: borrow<connection>, source: string, destination: string, wherefrom: list-side, whereto: list-side, timeout: duration-milliseconds) -> result<option<string-or-bytes>, error-code>;

  /// Pops the first element from one of multiple lists.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BLMPOP timeout numkeys key [ key ... ] 〈 LEFT | RIGHT 〉 [ COUNT count ]
  /// https://valkey.io/commands/blmpop/
  @since(version = 0.3.0-dev)
  blmpop: async func(connection: borrow<connection>, timeout: duration-milliseconds, keys: list<string>, end: list-side, count: option<integer>) -> result<option<tuple<string, list<string-or-bytes>>>, error-code>;

  /// Removes and returns the first element in a list.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BLPOP key [ key ... ] timeout
  /// https://valkey.io/commands/blpop/
  @since(version = 0.3.0-dev)
  blpop: async func(connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds) -> result<option<tuple<string, string-or-bytes>>, error-code>;

  /// Removes and returns the last element in a list.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BRPOP key [ key ... ] timeout
  /// https://valkey.io/commands/brpop/
  @since(version = 0.3.0-dev)
  brpop: async func(connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds) -> result<option<tuple<string, string-or-bytes>>, error-code>;

  /// Pops an element from a list, pushes it to another list and returns it.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BRPOPLPUSH source destination timeout
  /// https://valkey.io/commands/brpoplpush/
  @since(version = 0.3.0-dev)
  brpoplpush: async func(connection: borrow<connection>, source: string, destination: string, timeout: duration-milliseconds) -> result<option<string-or-bytes>, error-code>;

  /// Returns an element from a list by its index.
  ///
  /// LINDEX key index
  /// https://valkey.io/commands/lindex/
  @since(version = 0.3.0-dev)
  lindex: async func(connection: borrow<connection>, key: string, index: integer) -> result<option<string-or-bytes>, error-code>;

  /// Inserts an element before or after another element in a list.
  ///
  /// LINSERT key 〈 BEFORE | AFTER 〉 pivot element
  /// https://valkey.io/commands/linsert/
  @since(version = 0.3.0-dev)
  linsert: async func(connection: borrow<connection>, key: string, position: linsert-position, pivot: string-or-bytes, element: string-or-bytes) -> result<linsert-result, error-code>;

  /// Returns the length of a list.
  ///
  /// LLEN key
  /// https://valkey.io/commands/llen/
  @since(version = 0.3.0-dev)
  llen: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Returns an element after popping it from one list and pushing it to another.
  ///
  /// LMOVE source destination 〈 LEFT | RIGHT 〉 〈 LEFT | RIGHT 〉
  /// https://valkey.io/commands/lmove/
  @since(version = 0.3.0-dev)
  lmove: async func(connection: borrow<connection>, source: string, destination: string, wherefrom: list-side, whereto: list-side) -> result<option<string-or-bytes>, error-code>;

  /// Returns multiple elements from a list after removing them.
  ///
  /// LMPOP numkeys key [ key ... ] 〈 LEFT | RIGHT 〉 [ COUNT count ]
  /// https://valkey.io/commands/lmpop/
  @since(version = 0.3.0-dev)
  lmpop: async func(connection: borrow<connection>, keys: list<string>, end: list-side, count: option<integer>) -> result<option<tuple<string, list<string-or-bytes>>>, error-code>;

  /// Returns and removes one or more elements from the beginning of a list.
  ///
  /// Without a count, at most one element.
  ///
  /// LPOP key [ count ]
  /// https://valkey.io/commands/lpop/
  @since(version = 0.3.0-dev)
  lpop: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<string-or-bytes>, error-code>;

  /// Returns the index of matching elements in a list.
  ///
  /// Without a count, at most one position.
  ///
  /// LPOS key element [ RANK rank ] [ COUNT num-matches ] [ MAXLEN len ]
  /// https://valkey.io/commands/lpos/
  @since(version = 0.3.0-dev)
  lpos: async func(connection: borrow<connection>, key: string, element: string-or-bytes, rank: option<integer>, count: option<integer>, maxlen: option<integer>) -> result<list<integer>, error-code>;

  /// Prepends one or more elements to a list.
  ///
  /// LPUSH key element [ element ... ]
  /// https://valkey.io/commands/lpush/
  @since(version = 0.3.0-dev)
  lpush: async func(connection: borrow<connection>, key: string, elements: list<string-or-bytes>) -> result<integer, error-code>;

  /// Prepends one or more elements to a list only when the list exists.
  ///
  /// LPUSHX key element [ element ... ]
  /// https://valkey.io/commands/lpushx/
  @since(version = 0.3.0-dev)
  lpushx: async func(connection: borrow<connection>, key: string, elements: list<string-or-bytes>) -> result<integer, error-code>;

  /// Returns a range of elements from a list.
  ///
  /// LRANGE key start stop
  /// https://valkey.io/commands/lrange/
  @since(version = 0.3.0-dev)
  lrange: async func(connection: borrow<connection>, key: string, start: integer, stop: integer) -> result<list<string-or-bytes>, error-code>;

  /// Removes elements from a list.
  ///
  /// LREM key count element
  /// https://valkey.io/commands/lrem/
  @since(version = 0.3.0-dev)
  lrem: async func(connection: borrow<connection>, key: string, count: integer, element: string-or-bytes) -> result<integer, error-code>;

  /// Sets the value of an element in a list by its index.
  ///
  /// LSET key index element
  /// https://valkey.io/commands/lset/
  @since(version = 0.3.0-dev)
  lset: async func(connection: borrow<connection>, key: string, index: integer, element: string-or-bytes) -> result<_, error-code>;

  /// Removes elements from both ends of a list.
  ///
  /// LTRIM key start stop
  /// https://valkey.io/commands/ltrim/
  @since(version = 0.3.0-dev)
  ltrim: async func(connection: borrow<connection>, key: string, start: integer, stop: integer) -> result<_, error-code>;

  /// Returns and removes one or more elements from the end of a list.
  ///
  /// Without a count, at most one element.
  ///
  /// RPOP key [ count ]
  /// https://valkey.io/commands/rpop/
  @since(version = 0.3.0-dev)
  rpop: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<string-or-bytes>, error-code>;

  /// Returns the last element of a list after removing and pushing it to another list.
  ///
  /// RPOPLPUSH source destination
  /// https://valkey.io/commands/rpoplpush/
  @since(version = 0.3.0-dev)
  rpoplpush: async func(connection: borrow<connection>, source: string, destination: string) -> result<option<string-or-bytes>, error-code>;

  /// Appends one or more elements to a list.
  ///
  /// RPUSH key element [ element ... ]
  /// https://valkey.io/commands/rpush/
  @since(version = 0.3.0-dev)
  rpush: async func(connection: borrow<connection>, key: string, elements: list<string-or-bytes>) -> result<integer, error-code>;

  /// Appends one or more elements to a list only when the list exists.
  ///
  /// RPUSHX key element [ element ... ]
  /// https://valkey.io/commands/rpushx/
  @since(version = 0.3.0-dev)
  rpushx: async func(connection: borrow<connection>, key: string, elements: list<string-or-bytes>) -> result<integer, error-code>;

  /// Posts a message to a channel.
  ///
  /// PUBLISH channel message
  /// https://valkey.io/commands/publish/
  @since(version = 0.3.0-dev)
  publish: async func(connection: borrow<connection>, channel: string, message: string-or-bytes) -> result<integer, error-code>;

  /// Returns the active channels.
  ///
  /// PUBSUB CHANNELS [ pattern ]
  /// https://valkey.io/commands/pubsub-channels/
  @since(version = 0.3.0-dev)
  pubsub-channels: async func(connection: borrow<connection>, pattern: option<string>) -> result<list<string>, error-code>;

  /// Returns a count of unique pattern subscriptions.
  ///
  /// PUBSUB NUMPAT
  /// https://valkey.io/commands/pubsub-numpat/
  @since(version = 0.3.0-dev)
  pubsub-numpat: async func(connection: borrow<connection>) -> result<integer, error-code>;

  /// Returns a count of subscribers to channels.
  ///
  /// PUBSUB NUMSUB [ channel ] [ [ channel ] ... ]
  /// https://valkey.io/commands/pubsub-numsub/
  @since(version = 0.3.0-dev)
  pubsub-numsub: async func(connection: borrow<connection>, channels: option<list<string>>) -> result<map<string, integer>, error-code>;

  /// Returns the active shard channels.
  ///
  /// PUBSUB SHARDCHANNELS [ pattern ]
  /// https://valkey.io/commands/pubsub-shardchannels/
  @since(version = 0.3.0-dev)
  pubsub-shardchannels: async func(connection: borrow<connection>, pattern: option<string>) -> result<list<string>, error-code>;

  /// Returns the count of subscribers of shard channels.
  ///
  /// PUBSUB SHARDNUMSUB [ shardchannel [ shardchannel ... ] ]
  /// https://valkey.io/commands/pubsub-shardnumsub/
  @since(version = 0.3.0-dev)
  pubsub-shardnumsub: async func(connection: borrow<connection>, shardchannels: option<list<string>>) -> result<map<string, integer>, error-code>;

  /// Posts a message to a shard channel.
  ///
  /// SPUBLISH shardchannel message
  /// https://valkey.io/commands/spublish/
  @since(version = 0.3.0-dev)
  spublish: async func(connection: borrow<connection>, shardchannel: string, message: string-or-bytes) -> result<integer, error-code>;

  /// Executes a server-side Lua script.
  ///
  /// An error the script returns fails the call.
  ///
  /// EVAL script numkeys [ key [ key ... ] ] [ arg [ arg ... ] ]
  /// https://valkey.io/commands/eval/
  @since(version = 0.3.0-dev)
  eval: async func(connection: borrow<connection>, script: string, keys: option<list<string>>, args: option<list<string-or-bytes>>) -> result<resp-value, error-code>;

  /// Executes a read-only server-side Lua script.
  ///
  /// An error the script returns fails the call.
  ///
  /// EVAL_RO script numkeys [ key [ key ... ] ] [ arg [ arg ... ] ]
  /// https://valkey.io/commands/eval_ro/
  @since(version = 0.3.0-dev)
  eval-ro: async func(connection: borrow<connection>, script: string, keys: option<list<string>>, args: option<list<string-or-bytes>>) -> result<resp-value, error-code>;

  /// Executes a server-side Lua script by SHA1 digest.
  ///
  /// An error the script returns fails the call.
  ///
  /// EVALSHA sha1 numkeys [ key [ key ... ] ] [ arg [ arg ... ] ]
  /// https://valkey.io/commands/evalsha/
  @since(version = 0.3.0-dev)
  evalsha: async func(connection: borrow<connection>, sha1: string, keys: option<list<string>>, args: option<list<string-or-bytes>>) -> result<resp-value, error-code>;

  /// Executes a read-only server-side Lua script by SHA1 digest.
  ///
  /// An error the script returns fails the call.
  ///
  /// EVALSHA_RO sha1 numkeys [ key [ key ... ] ] [ arg [ arg ... ] ]
  /// https://valkey.io/commands/evalsha_ro/
  @since(version = 0.3.0-dev)
  evalsha-ro: async func(connection: borrow<connection>, sha1: string, keys: option<list<string>>, args: option<list<string-or-bytes>>) -> result<resp-value, error-code>;

  /// Invokes a function.
  ///
  /// An error the function returns fails the call.
  ///
  /// FCALL function numkeys [ key [ key ... ] ] [ arg [ arg ... ] ]
  /// https://valkey.io/commands/fcall/
  @since(version = 0.3.0-dev)
  fcall: async func(connection: borrow<connection>, function: string, keys: option<list<string>>, args: option<list<string-or-bytes>>) -> result<resp-value, error-code>;

  /// Invokes a read-only function.
  ///
  /// An error the function returns fails the call.
  ///
  /// FCALL_RO function numkeys [ key [ key ... ] ] [ arg [ arg ... ] ]
  /// https://valkey.io/commands/fcall_ro/
  @since(version = 0.3.0-dev)
  fcall-ro: async func(connection: borrow<connection>, function: string, keys: option<list<string>>, args: option<list<string-or-bytes>>) -> result<resp-value, error-code>;

  /// Deletes a library and its functions.
  ///
  /// FUNCTION DELETE library-name
  /// https://valkey.io/commands/function-delete/
  @since(version = 0.3.0-dev)
  function-delete: async func(connection: borrow<connection>, library-name: string) -> result<_, error-code>;

  /// Dumps all libraries into a serialized binary payload.
  ///
  /// FUNCTION DUMP
  /// https://valkey.io/commands/function-dump/
  @since(version = 0.3.0-dev)
  function-dump: async func(connection: borrow<connection>) -> result<bytes, error-code>;

  /// Deletes all libraries and functions.
  ///
  /// FUNCTION FLUSH [ ASYNC | SYNC ]
  /// https://valkey.io/commands/function-flush/
  @since(version = 0.3.0-dev)
  function-flush: async func(connection: borrow<connection>, mode: option<flush-mode>) -> result<_, error-code>;

  /// Terminates a function during execution.
  ///
  /// FUNCTION KILL
  /// https://valkey.io/commands/function-kill/
  @since(version = 0.3.0-dev)
  function-kill: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Returns information about all libraries.
  ///
  /// FUNCTION LIST [ LIBRARYNAME library-name-pattern ] [ WITHCODE ]
  /// https://valkey.io/commands/function-list/
  @since(version = 0.3.0-dev)
  function-list: async func(connection: borrow<connection>, library-name-pattern: option<string>, withcode: bool) -> result<list<function-list-library>, error-code>;

  /// Creates a library.
  ///
  /// FUNCTION LOAD [ REPLACE ] function-code
  /// https://valkey.io/commands/function-load/
  @since(version = 0.3.0-dev)
  function-load: async func(connection: borrow<connection>, replace: bool, function-code: string) -> result<string, error-code>;

  /// Restores all libraries from a payload.
  ///
  /// FUNCTION RESTORE serialized-value [ FLUSH | APPEND | REPLACE ]
  /// https://valkey.io/commands/function-restore/
  @since(version = 0.3.0-dev)
  function-restore: async func(connection: borrow<connection>, serialized-value: bytes, policy: option<function-restore-policy>) -> result<_, error-code>;

  /// Returns information about a function during execution.
  ///
  /// FUNCTION STATS
  /// https://valkey.io/commands/function-stats/
  @since(version = 0.3.0-dev)
  function-stats: async func(connection: borrow<connection>) -> result<function-stats-reply, error-code>;

  /// Determines whether server-side Lua scripts exist in the script cache.
  ///
  /// SCRIPT EXISTS sha1 [ sha1 ... ]
  /// https://valkey.io/commands/script-exists/
  @since(version = 0.3.0-dev)
  script-exists: async func(connection: borrow<connection>, sha1s: list<string>) -> result<list<bool>, error-code>;

  /// Removes all server-side Lua scripts from the script cache.
  ///
  /// SCRIPT FLUSH [ ASYNC | SYNC ]
  /// https://valkey.io/commands/script-flush/
  @since(version = 0.3.0-dev)
  script-flush: async func(connection: borrow<connection>, mode: option<flush-mode>) -> result<_, error-code>;

  /// Terminates a server-side Lua script during execution.
  ///
  /// SCRIPT KILL
  /// https://valkey.io/commands/script-kill/
  @since(version = 0.3.0-dev)
  script-kill: async func(connection: borrow<connection>) -> result<_, error-code>;

  /// Loads a server-side Lua script to the script cache.
  ///
  /// SCRIPT LOAD script
  /// https://valkey.io/commands/script-load/
  @since(version = 0.3.0-dev)
  script-load: async func(connection: borrow<connection>, script: string) -> result<string, error-code>;

  /// Show server-side Lua script in the script cache.
  ///
  /// SCRIPT SHOW sha1
  /// https://valkey.io/commands/script-show/
  @since(version = 0.3.0-dev)
  script-show: async func(connection: borrow<connection>, sha1: string) -> result<string, error-code>;

  /// Adds one or more members to a set.
  ///
  /// SADD key member [ member ... ]
  /// https://valkey.io/commands/sadd/
  @since(version = 0.3.0-dev)
  sadd: async func(connection: borrow<connection>, key: string, members: list<string-or-bytes>) -> result<integer, error-code>;

  /// Returns the number of members in a set.
  ///
  /// SCARD key
  /// https://valkey.io/commands/scard/
  @since(version = 0.3.0-dev)
  scard: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Returns the difference of multiple sets.
  ///
  /// SDIFF key [ key ... ]
  /// https://valkey.io/commands/sdiff/
  @since(version = 0.3.0-dev)
  sdiff: async func(connection: borrow<connection>, keys: list<string>) -> result<list<string-or-bytes>, error-code>;

  /// Stores the difference of multiple sets in a key.
  ///
  /// SDIFFSTORE destination key [ key ... ]
  /// https://valkey.io/commands/sdiffstore/
  @since(version = 0.3.0-dev)
  sdiffstore: async func(connection: borrow<connection>, destination: string, keys: list<string>) -> result<integer, error-code>;

  /// Returns the intersect of multiple sets.
  ///
  /// SINTER key [ key ... ]
  /// https://valkey.io/commands/sinter/
  @since(version = 0.3.0-dev)
  sinter: async func(connection: borrow<connection>, keys: list<string>) -> result<list<string-or-bytes>, error-code>;

  /// Returns the number of members of the intersect of multiple sets.
  ///
  /// SINTERCARD numkeys key [ key ... ] [ LIMIT limit ]
  /// https://valkey.io/commands/sintercard/
  @since(version = 0.3.0-dev)
  sintercard: async func(connection: borrow<connection>, keys: list<string>, limit: option<integer>) -> result<integer, error-code>;

  /// Stores the intersect of multiple sets in a key.
  ///
  /// SINTERSTORE destination key [ key ... ]
  /// https://valkey.io/commands/sinterstore/
  @since(version = 0.3.0-dev)
  sinterstore: async func(connection: borrow<connection>, destination: string, keys: list<string>) -> result<integer, error-code>;

  /// Determines whether a member belongs to a set.
  ///
  /// False when the key does not exist.
  ///
  /// See also `sismember-xx`.
  ///
  /// SISMEMBER key member
  /// https://valkey.io/commands/sismember/
  @since(version = 0.3.0-dev)
  sismember: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<bool, error-code>;

  /// Determines whether a member belongs to a set.
  ///
  /// The `XX` form, none when the key does not exist, rather than false.
  ///
  /// See also `sismember`.
  ///
  /// SISMEMBER key member XX
  /// https://valkey.io/commands/sismember/
  @since(version = 0.3.0-dev)
  sismember-xx: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<option<bool>, error-code>;

  /// Returns all members of a set.
  ///
  /// SMEMBERS key
  /// https://valkey.io/commands/smembers/
  @since(version = 0.3.0-dev)
  smembers: async func(connection: borrow<connection>, key: string) -> result<list<string-or-bytes>, error-code>;

  /// Determines whether multiple members belong to a set.
  ///
  /// SMISMEMBER key member [ member ... ]
  /// https://valkey.io/commands/smismember/
  @since(version = 0.3.0-dev)
  smismember: async func(connection: borrow<connection>, key: string, members: list<string-or-bytes>) -> result<list<bool>, error-code>;

  /// Moves a member from one set to another.
  ///
  /// SMOVE source destination member
  /// https://valkey.io/commands/smove/
  @since(version = 0.3.0-dev)
  smove: async func(connection: borrow<connection>, source: string, destination: string, member: string-or-bytes) -> result<bool, error-code>;

  /// Returns one or more random members from a set after removing them.
  ///
  /// Without a count, at most one member.
  ///
  /// SPOP key [ count ]
  /// https://valkey.io/commands/spop/
  @since(version = 0.3.0-dev)
  spop: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<string-or-bytes>, error-code>;

  /// Gets one or multiple random members from a set.
  ///
  /// Without a count, at most one member.
  ///
  /// SRANDMEMBER key [ count ]
  /// https://valkey.io/commands/srandmember/
  @since(version = 0.3.0-dev)
  srandmember: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<string-or-bytes>, error-code>;

  /// Removes one or more members from a set.
  ///
  /// SREM key member [ member ... ]
  /// https://valkey.io/commands/srem/
  @since(version = 0.3.0-dev)
  srem: async func(connection: borrow<connection>, key: string, members: list<string-or-bytes>) -> result<integer, error-code>;

  /// Iterates over members of a set.
  ///
  /// SSCAN key cursor [ MATCH pattern ] [ COUNT count ]
  /// https://valkey.io/commands/sscan/
  @since(version = 0.3.0-dev)
  sscan: async func(connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>) -> result<tuple<option<cursor>, list<string-or-bytes>>, error-code>;

  /// Returns the union of multiple sets.
  ///
  /// SUNION key [ key ... ]
  /// https://valkey.io/commands/sunion/
  @since(version = 0.3.0-dev)
  sunion: async func(connection: borrow<connection>, keys: list<string>) -> result<list<string-or-bytes>, error-code>;

  /// Stores the union of multiple sets in a key.
  ///
  /// SUNIONSTORE destination key [ key ... ]
  /// https://valkey.io/commands/sunionstore/
  @since(version = 0.3.0-dev)
  sunionstore: async func(connection: borrow<connection>, destination: string, keys: list<string>) -> result<integer, error-code>;

  /// Sorts the elements in a list, a set, or a sorted set, optionally storing the result.
  ///
  /// Each row is the element, or with `get`, the value of each pattern, none when its key does
  /// not exist.
  ///
  /// See also `sort-store`.
  ///
  /// SORT key [ BY pattern ] [ LIMIT offset count ] [ GET pattern ... ] [ ASC | DESC ] [ ALPHA ]
  /// https://valkey.io/commands/sort/
  @since(version = 0.3.0-dev)
  sort: async func(connection: borrow<connection>, key: string, opts: option<sort-opts>) -> result<list<list<option<string-or-bytes>>>, error-code>;

  /// Sorts the elements in a list, a set, or a sorted set, optionally storing the result.
  ///
  /// The `STORE` form, storing the elements as a list, returning how many.
  ///
  /// See also `sort`.
  ///
  /// SORT key [ BY pattern ] [ LIMIT offset count ] [ GET pattern ... ] [ ASC | DESC ] [ ALPHA ] STORE destination
  /// https://valkey.io/commands/sort/
  @since(version = 0.3.0-dev)
  sort-store: async func(connection: borrow<connection>, key: string, opts: option<sort-opts>, destination: string) -> result<integer, error-code>;

  /// Returns the sorted elements of a list, a set, or a sorted set.
  ///
  /// Each row is the element, or with `get`, the value of each pattern, none when its key does
  /// not exist.
  ///
  /// SORT_RO key [ BY pattern ] [ LIMIT offset count ] [ GET pattern ... ] [ ASC | DESC ] [ ALPHA ]
  /// https://valkey.io/commands/sort_ro/
  @since(version = 0.3.0-dev)
  sort-ro: async func(connection: borrow<connection>, key: string, opts: option<sort-ro-opts>) -> result<list<list<option<string-or-bytes>>>, error-code>;

  /// Removes and returns a member by score from one or more sorted sets.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BZMPOP timeout numkeys key [ key ... ] 〈 MIN | MAX 〉 [ COUNT count ]
  /// https://valkey.io/commands/bzmpop/
  @since(version = 0.3.0-dev)
  bzmpop: async func(connection: borrow<connection>, timeout: duration-milliseconds, keys: list<string>, end: bzmpop-end, count: option<integer>) -> result<option<tuple<string, list<tuple<string-or-bytes, double>>>>, error-code>;

  /// Removes and returns the member with the highest score from one or more sorted sets.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BZPOPMAX key [ key ... ] timeout
  /// https://valkey.io/commands/bzpopmax/
  @since(version = 0.3.0-dev)
  bzpopmax: async func(connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds) -> result<option<tuple<string, string-or-bytes, double>>, error-code>;

  /// Removes and returns the member with the lowest score from one or more sorted sets.
  ///
  /// Returns none when the timeout passed. The connection waits too, replies to commands sent
  /// after it on the connection wait behind it. Use a connection of your own.
  ///
  /// BZPOPMIN key [ key ... ] timeout
  /// https://valkey.io/commands/bzpopmin/
  @since(version = 0.3.0-dev)
  bzpopmin: async func(connection: borrow<connection>, keys: list<string>, timeout: duration-milliseconds) -> result<option<tuple<string, string-or-bytes, double>>, error-code>;

  /// Adds one or more members to a sorted set, or updates their scores.
  ///
  /// See also `zadd-incr`.
  ///
  /// ZADD key [ NX | XX ] [ GT | LT ] [ CH ] score member [ score member ... ]
  /// https://valkey.io/commands/zadd/
  @since(version = 0.3.0-dev)
  zadd: async func(connection: borrow<connection>, key: string, condition: option<zadd-condition>, comparison: option<zadd-comparison>, changed: bool, score-and-members: list<tuple<double, string-or-bytes>>) -> result<option<integer>, error-code>;

  /// Adds one or more members to a sorted set, or updates their scores.
  ///
  /// The `INCR` form, returning the new score, none when the condition or comparison prevented
  /// it.
  ///
  /// See also `zadd`.
  ///
  /// ZADD key [ NX | XX ] [ GT | LT ] INCR score member
  /// https://valkey.io/commands/zadd/
  @since(version = 0.3.0-dev)
  zadd-incr: async func(connection: borrow<connection>, key: string, condition: option<zadd-condition>, comparison: option<zadd-comparison>, increment: double, member: string-or-bytes) -> result<option<double>, error-code>;

  /// Returns the number of members in a sorted set.
  ///
  /// ZCARD key
  /// https://valkey.io/commands/zcard/
  @since(version = 0.3.0-dev)
  zcard: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Returns the count of members in a sorted set that have scores within a range.
  ///
  /// ZCOUNT key min max
  /// https://valkey.io/commands/zcount/
  @since(version = 0.3.0-dev)
  zcount: async func(connection: borrow<connection>, key: string, min: score-bound, max: score-bound) -> result<integer, error-code>;

  /// Returns the difference between multiple sorted sets.
  ///
  /// See also `zdiff-withscores`.
  ///
  /// ZDIFF numkeys key [ key ... ]
  /// https://valkey.io/commands/zdiff/
  @since(version = 0.3.0-dev)
  zdiff: async func(connection: borrow<connection>, keys: list<string>) -> result<list<string-or-bytes>, error-code>;

  /// Returns the difference between multiple sorted sets.
  ///
  /// The `WITHSCORES` form, the members and their scores.
  ///
  /// See also `zdiff`.
  ///
  /// ZDIFF numkeys key [ key ... ] WITHSCORES
  /// https://valkey.io/commands/zdiff/
  @since(version = 0.3.0-dev)
  zdiff-withscores: async func(connection: borrow<connection>, keys: list<string>) -> result<list<tuple<string-or-bytes, double>>, error-code>;

  /// Stores the difference of multiple sorted sets in a key.
  ///
  /// ZDIFFSTORE destination numkeys key [ key ... ]
  /// https://valkey.io/commands/zdiffstore/
  @since(version = 0.3.0-dev)
  zdiffstore: async func(connection: borrow<connection>, destination: string, keys: list<string>) -> result<integer, error-code>;

  /// Increments the score of a member in a sorted set.
  ///
  /// ZINCRBY key increment member
  /// https://valkey.io/commands/zincrby/
  @since(version = 0.3.0-dev)
  zincrby: async func(connection: borrow<connection>, key: string, increment: double, member: string-or-bytes) -> result<double, error-code>;

  /// Returns the intersect of multiple sorted sets.
  ///
  /// See also `zinter-withscores`.
  ///
  /// ZINTER numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ]
  /// https://valkey.io/commands/zinter/
  @since(version = 0.3.0-dev)
  zinter: async func(connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>) -> result<list<string-or-bytes>, error-code>;

  /// Returns the intersect of multiple sorted sets.
  ///
  /// The `WITHSCORES` form, the members and their combined scores.
  ///
  /// See also `zinter`.
  ///
  /// ZINTER numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] WITHSCORES
  /// https://valkey.io/commands/zinter/
  @since(version = 0.3.0-dev)
  zinter-withscores: async func(connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>) -> result<list<tuple<string-or-bytes, double>>, error-code>;

  /// Returns the number of members of the intersect of multiple sorted sets.
  ///
  /// ZINTERCARD numkeys key [ key ... ] [ LIMIT limit ]
  /// https://valkey.io/commands/zintercard/
  @since(version = 0.3.0-dev)
  zintercard: async func(connection: borrow<connection>, keys: list<string>, limit: option<integer>) -> result<integer, error-code>;

  /// Stores the intersect of multiple sorted sets in a key.
  ///
  /// ZINTERSTORE destination numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ]
  /// https://valkey.io/commands/zinterstore/
  @since(version = 0.3.0-dev)
  zinterstore: async func(connection: borrow<connection>, destination: string, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>) -> result<integer, error-code>;

  /// Returns the number of members in a sorted set within a lexicographical range.
  ///
  /// ZLEXCOUNT key min max
  /// https://valkey.io/commands/zlexcount/
  @since(version = 0.3.0-dev)
  zlexcount: async func(connection: borrow<connection>, key: string, min: lex-bound, max: lex-bound) -> result<integer, error-code>;

  /// Returns the highest- or lowest-scoring members from one or more sorted sets after removing them.
  ///
  /// ZMPOP numkeys key [ key ... ] 〈 MIN | MAX 〉 [ COUNT count ]
  /// https://valkey.io/commands/zmpop/
  @since(version = 0.3.0-dev)
  zmpop: async func(connection: borrow<connection>, keys: list<string>, end: zmpop-end, count: option<integer>) -> result<option<tuple<string, list<tuple<string-or-bytes, double>>>>, error-code>;

  /// Returns the score of one or more members in a sorted set.
  ///
  /// ZMSCORE key member [ member ... ]
  /// https://valkey.io/commands/zmscore/
  @since(version = 0.3.0-dev)
  zmscore: async func(connection: borrow<connection>, key: string, members: list<string-or-bytes>) -> result<list<option<double>>, error-code>;

  /// Returns the highest-scoring members from a sorted set after removing them.
  ///
  /// Without a count, at most one member.
  ///
  /// ZPOPMAX key [ count ]
  /// https://valkey.io/commands/zpopmax/
  @since(version = 0.3.0-dev)
  zpopmax: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<tuple<string-or-bytes, double>>, error-code>;

  /// Returns the lowest-scoring members from a sorted set after removing them.
  ///
  /// Without a count, at most one member.
  ///
  /// ZPOPMIN key [ count ]
  /// https://valkey.io/commands/zpopmin/
  @since(version = 0.3.0-dev)
  zpopmin: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<tuple<string-or-bytes, double>>, error-code>;

  /// Returns one or more random members from a sorted set.
  ///
  /// Without a count, at most one member.
  ///
  /// See also `zrandmember-withscores`.
  ///
  /// ZRANDMEMBER key [ count ]
  /// https://valkey.io/commands/zrandmember/
  @since(version = 0.3.0-dev)
  zrandmember: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<list<string-or-bytes>, error-code>;

  /// Returns one or more random members from a sorted set.
  ///
  /// The `WITHSCORES` form, the members and their scores.
  ///
  /// See also `zrandmember`.
  ///
  /// ZRANDMEMBER key count WITHSCORES
  /// https://valkey.io/commands/zrandmember/
  @since(version = 0.3.0-dev)
  zrandmember-withscores: async func(connection: borrow<connection>, key: string, count: integer) -> result<list<tuple<string-or-bytes, double>>, error-code>;

  /// Returns members in a sorted set within a range of indexes.
  ///
  /// Also covers ZRANGEBYLEX, ZRANGEBYSCORE, ZREVRANGE, ZREVRANGEBYLEX and ZREVRANGEBYSCORE. A
  /// limit fails the command unless the range is by score or by lex. With `xx`, returns none when
  /// the key does not exist.
  ///
  /// See also `zrange-withscores`.
  ///
  /// ZRANGE key start stop [ BYSCORE | BYLEX ] [ REV ] [ LIMIT offset count ] [ XX ]
  /// https://valkey.io/commands/zrange/
  @since(version = 0.3.0-dev)
  zrange: async func(connection: borrow<connection>, key: string, range: zrange-by, rev: bool, limit: option<limit>, xx: bool) -> result<option<list<string-or-bytes>>, error-code>;

  /// Returns members in a sorted set within a range of indexes.
  ///
  /// The `WITHSCORES` form, the members and their scores. A limit fails the command unless the
  /// range is by score. With `xx`, returns none when the key does not exist.
  ///
  /// See also `zrange`.
  ///
  /// ZRANGE key start stop [ BYSCORE ] [ REV ] [ LIMIT offset count ] WITHSCORES [ XX ]
  /// https://valkey.io/commands/zrange/
  @since(version = 0.3.0-dev)
  zrange-withscores: async func(connection: borrow<connection>, key: string, range: zrange-withscores-by, rev: bool, limit: option<limit>, xx: bool) -> result<option<list<tuple<string-or-bytes, double>>>, error-code>;

  /// Stores a range of members from sorted set in a key.
  ///
  /// A limit fails the command unless the range is by score or by lex.
  ///
  /// ZRANGESTORE dst src min max [ BYSCORE | BYLEX ] [ REV ] [ LIMIT offset count ]
  /// https://valkey.io/commands/zrangestore/
  @since(version = 0.3.0-dev)
  zrangestore: async func(connection: borrow<connection>, destination: string, source: string, range: zrangestore-by, rev: bool, limit: option<limit>) -> result<integer, error-code>;

  /// Returns the index of a member in a sorted set ordered by ascending scores.
  ///
  /// See also `zrank-withscore`.
  ///
  /// ZRANK key member
  /// https://valkey.io/commands/zrank/
  @since(version = 0.3.0-dev)
  zrank: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<option<integer>, error-code>;

  /// Returns the index of a member in a sorted set ordered by ascending scores.
  ///
  /// The `WITHSCORE` form, the position and the score.
  ///
  /// See also `zrank`.
  ///
  /// ZRANK key member WITHSCORE
  /// https://valkey.io/commands/zrank/
  @since(version = 0.3.0-dev)
  zrank-withscore: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<option<tuple<integer, double>>, error-code>;

  /// Removes one or more members from a sorted set.
  ///
  /// ZREM key member [ member ... ]
  /// https://valkey.io/commands/zrem/
  @since(version = 0.3.0-dev)
  zrem: async func(connection: borrow<connection>, key: string, members: list<string-or-bytes>) -> result<integer, error-code>;

  /// Removes members in a sorted set within a lexicographical range.
  ///
  /// ZREMRANGEBYLEX key min max
  /// https://valkey.io/commands/zremrangebylex/
  @since(version = 0.3.0-dev)
  zremrangebylex: async func(connection: borrow<connection>, key: string, min: lex-bound, max: lex-bound) -> result<integer, error-code>;

  /// Removes members in a sorted set within a range of indexes.
  ///
  /// ZREMRANGEBYRANK key start stop
  /// https://valkey.io/commands/zremrangebyrank/
  @since(version = 0.3.0-dev)
  zremrangebyrank: async func(connection: borrow<connection>, key: string, start: integer, stop: integer) -> result<integer, error-code>;

  /// Removes members in a sorted set within a range of scores.
  ///
  /// ZREMRANGEBYSCORE key min max
  /// https://valkey.io/commands/zremrangebyscore/
  @since(version = 0.3.0-dev)
  zremrangebyscore: async func(connection: borrow<connection>, key: string, min: score-bound, max: score-bound) -> result<integer, error-code>;

  /// Returns the index of a member in a sorted set ordered by descending scores.
  ///
  /// See also `zrevrank-withscore`.
  ///
  /// ZREVRANK key member
  /// https://valkey.io/commands/zrevrank/
  @since(version = 0.3.0-dev)
  zrevrank: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<option<integer>, error-code>;

  /// Returns the index of a member in a sorted set ordered by descending scores.
  ///
  /// The `WITHSCORE` form, the position and the score.
  ///
  /// See also `zrevrank`.
  ///
  /// ZREVRANK key member WITHSCORE
  /// https://valkey.io/commands/zrevrank/
  @since(version = 0.3.0-dev)
  zrevrank-withscore: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<option<tuple<integer, double>>, error-code>;

  /// Iterates over members and scores of a sorted set.
  ///
  /// See also `zscan-noscores`.
  ///
  /// ZSCAN key cursor [ MATCH pattern ] [ COUNT count ]
  /// https://valkey.io/commands/zscan/
  @since(version = 0.3.0-dev)
  zscan: async func(connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>) -> result<tuple<option<cursor>, list<tuple<string-or-bytes, double>>>, error-code>;

  /// Iterates over members and scores of a sorted set.
  ///
  /// The `NOSCORES` form, the members only.
  ///
  /// See also `zscan`.
  ///
  /// ZSCAN key cursor [ MATCH pattern ] [ COUNT count ] NOSCORES
  /// https://valkey.io/commands/zscan/
  @since(version = 0.3.0-dev)
  zscan-noscores: async func(connection: borrow<connection>, key: string, cursor: cursor, match: option<string>, count: option<integer>) -> result<tuple<option<cursor>, list<string-or-bytes>>, error-code>;

  /// Returns the score of a member in a sorted set.
  ///
  /// ZSCORE key member
  /// https://valkey.io/commands/zscore/
  @since(version = 0.3.0-dev)
  zscore: async func(connection: borrow<connection>, key: string, member: string-or-bytes) -> result<option<double>, error-code>;

  /// Returns the union of multiple sorted sets.
  ///
  /// See also `zunion-withscores`.
  ///
  /// ZUNION numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ]
  /// https://valkey.io/commands/zunion/
  @since(version = 0.3.0-dev)
  zunion: async func(connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>) -> result<list<string-or-bytes>, error-code>;

  /// Returns the union of multiple sorted sets.
  ///
  /// The `WITHSCORES` form, the members and their combined scores.
  ///
  /// See also `zunion`.
  ///
  /// ZUNION numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ] WITHSCORES
  /// https://valkey.io/commands/zunion/
  @since(version = 0.3.0-dev)
  zunion-withscores: async func(connection: borrow<connection>, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>) -> result<list<tuple<string-or-bytes, double>>, error-code>;

  /// Stores the union of multiple sorted sets in a key.
  ///
  /// ZUNIONSTORE destination numkeys key [ key ... ] [ WEIGHTS weight [ weight ... ] ] [ AGGREGATE SUM | MIN | MAX ]
  /// https://valkey.io/commands/zunionstore/
  @since(version = 0.3.0-dev)
  zunionstore: async func(connection: borrow<connection>, destination: string, keys: list<string>, weights: option<list<double>>, aggregate: option<zset-aggregate>) -> result<integer, error-code>;

  /// Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.
  ///
  /// XACK key group ID [ ID ... ]
  /// https://valkey.io/commands/xack/
  @since(version = 0.3.0-dev)
  xack: async func(connection: borrow<connection>, key: string, group: string, ids: list<stream-id>) -> result<integer, error-code>;

  /// Appends a new message to a stream.
  ///
  /// XADD key [ NOMKSTREAM ] [ 〈 MAXLEN | MINID 〉 [ = | ~ ] threshold [ LIMIT count ] ] 〈 * | id 〉 field value [ field value ... ]
  /// https://valkey.io/commands/xadd/
  @since(version = 0.3.0-dev)
  xadd: async func(connection: borrow<connection>, key: string, nomkstream: bool, trim: option<stream-trim>, id: stream-id, field-and-values: list<tuple<string, string-or-bytes>>) -> result<option<stream-id>, error-code>;

  /// Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to a consumer group member.
  ///
  /// A start of none scans from the beginning, `0-0`. The next start is returned, none once the
  /// scan is complete.
  ///
  /// See also `xautoclaim-justid`.
  ///
  /// XAUTOCLAIM key group consumer min-idle-time start [ COUNT count ]
  /// https://valkey.io/commands/xautoclaim/
  @since(version = 0.3.0-dev)
  xautoclaim: async func(connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, start: option<stream-id>, count: option<integer>) -> result<tuple<option<stream-id>, list<tuple<stream-id, map<string, string-or-bytes>>>, list<stream-id>>, error-code>;

  /// Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to a consumer group member.
  ///
  /// The `JUSTID` form, the IDs only. A start of none scans from the beginning, `0-0`. The next
  /// start is returned, none once the scan is complete.
  ///
  /// See also `xautoclaim`.
  ///
  /// XAUTOCLAIM key group consumer min-idle-time start [ COUNT count ] JUSTID
  /// https://valkey.io/commands/xautoclaim/
  @since(version = 0.3.0-dev)
  xautoclaim-justid: async func(connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, start: option<stream-id>, count: option<integer>) -> result<tuple<option<stream-id>, list<stream-id>, list<stream-id>>, error-code>;

  /// Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered to a consumer group member.
  ///
  /// See also `xclaim-justid`.
  ///
  /// XCLAIM key group consumer min-idle-time ID [ ID ... ] [ IDLE ms ] [ TIME unix-time-milliseconds ] [ RETRYCOUNT count ] [ FORCE ] [ LASTID lastid ]
  /// https://valkey.io/commands/xclaim/
  @since(version = 0.3.0-dev)
  xclaim: async func(connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, ids: list<stream-id>, opts: option<xclaim-opts>) -> result<list<tuple<stream-id, map<string, string-or-bytes>>>, error-code>;

  /// Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered to a consumer group member.
  ///
  /// The `JUSTID` form, the IDs only.
  ///
  /// See also `xclaim`.
  ///
  /// XCLAIM key group consumer min-idle-time ID [ ID ... ] [ IDLE ms ] [ TIME unix-time-milliseconds ] [ RETRYCOUNT count ] [ FORCE ] JUSTID [ LASTID lastid ]
  /// https://valkey.io/commands/xclaim/
  @since(version = 0.3.0-dev)
  xclaim-justid: async func(connection: borrow<connection>, key: string, group: string, consumer: string, min-idle-time: duration-milliseconds, ids: list<stream-id>, opts: option<xclaim-opts>) -> result<list<stream-id>, error-code>;

  /// Returns the number of messages after removing them from a stream.
  ///
  /// XDEL key ID [ ID ... ]
  /// https://valkey.io/commands/xdel/
  @since(version = 0.3.0-dev)
  xdel: async func(connection: borrow<connection>, key: string, ids: list<stream-id>) -> result<integer, error-code>;

  /// Creates a consumer group.
  ///
  /// XGROUP CREATE key group 〈 id | $ 〉 [ MKSTREAM ] [ ENTRIESREAD entriesread ]
  /// https://valkey.io/commands/xgroup-create/
  @since(version = 0.3.0-dev)
  xgroup-create: async func(connection: borrow<connection>, key: string, group: string, id: stream-id, mkstream: bool, entriesread: option<integer>) -> result<_, error-code>;

  /// Creates a consumer in a consumer group.
  ///
  /// XGROUP CREATECONSUMER key group consumer
  /// https://valkey.io/commands/xgroup-createconsumer/
  @since(version = 0.3.0-dev)
  xgroup-createconsumer: async func(connection: borrow<connection>, key: string, group: string, consumer: string) -> result<bool, error-code>;

  /// Deletes a consumer from a consumer group.
  ///
  /// XGROUP DELCONSUMER key group consumer
  /// https://valkey.io/commands/xgroup-delconsumer/
  @since(version = 0.3.0-dev)
  xgroup-delconsumer: async func(connection: borrow<connection>, key: string, group: string, consumer: string) -> result<integer, error-code>;

  /// Destroys a consumer group.
  ///
  /// XGROUP DESTROY key group
  /// https://valkey.io/commands/xgroup-destroy/
  @since(version = 0.3.0-dev)
  xgroup-destroy: async func(connection: borrow<connection>, key: string, group: string) -> result<bool, error-code>;

  /// Sets the last-delivered ID of a consumer group.
  ///
  /// XGROUP SETID key group 〈 id | $ 〉 [ ENTRIESREAD entriesread ]
  /// https://valkey.io/commands/xgroup-setid/
  @since(version = 0.3.0-dev)
  xgroup-setid: async func(connection: borrow<connection>, key: string, group: string, id: stream-id, entriesread: option<integer>) -> result<_, error-code>;

  /// Returns a list of the consumers in a consumer group.
  ///
  /// XINFO CONSUMERS key group
  /// https://valkey.io/commands/xinfo-consumers/
  @since(version = 0.3.0-dev)
  xinfo-consumers: async func(connection: borrow<connection>, key: string, group: string) -> result<list<xinfo-consumers-entry>, error-code>;

  /// Returns a list of the consumer groups of a stream.
  ///
  /// XINFO GROUPS key
  /// https://valkey.io/commands/xinfo-groups/
  @since(version = 0.3.0-dev)
  xinfo-groups: async func(connection: borrow<connection>, key: string) -> result<list<xinfo-groups-entry>, error-code>;

  /// Returns information about a stream.
  ///
  /// See also `xinfo-stream-full`.
  ///
  /// XINFO STREAM key
  /// https://valkey.io/commands/xinfo-stream/
  @since(version = 0.3.0-dev)
  xinfo-stream: async func(connection: borrow<connection>, key: string) -> result<xinfo-stream-reply, error-code>;

  /// Returns information about a stream.
  ///
  /// The `FULL` form, with the entries, groups and consumers.
  ///
  /// See also `xinfo-stream`.
  ///
  /// XINFO STREAM key FULL [ COUNT count ]
  /// https://valkey.io/commands/xinfo-stream/
  @since(version = 0.3.0-dev)
  xinfo-stream-full: async func(connection: borrow<connection>, key: string, count: option<integer>) -> result<xinfo-stream-reply-full, error-code>;

  /// Returns the number of messages in a stream.
  ///
  /// XLEN key
  /// https://valkey.io/commands/xlen/
  @since(version = 0.3.0-dev)
  xlen: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Returns the information and entries from a stream consumer group's pending entries list.
  ///
  /// The summary form.
  ///
  /// See also `xpending-extended`.
  ///
  /// XPENDING key group
  /// https://valkey.io/commands/xpending/
  @since(version = 0.3.0-dev)
  xpending: async func(connection: borrow<connection>, key: string, group: string) -> result<xpending-summary, error-code>;

  /// Returns the information and entries from a stream consumer group's pending entries list.
  ///
  /// The extended form, the pending entries in the range.
  ///
  /// See also `xpending`.
  ///
  /// XPENDING key group [ IDLE min-idle-time ] start end count [ consumer ]
  /// https://valkey.io/commands/xpending/
  @since(version = 0.3.0-dev)
  xpending-extended: async func(connection: borrow<connection>, key: string, group: string, min-idle-time: option<duration-milliseconds>, start: stream-id, end: stream-id, count: integer, consumer: option<string>) -> result<list<xpending-extended-entry>, error-code>;

  /// Returns the messages from a stream within a range of IDs.
  ///
  /// XRANGE key start end [ COUNT count ]
  /// https://valkey.io/commands/xrange/
  @since(version = 0.3.0-dev)
  xrange: async func(connection: borrow<connection>, key: string, start: stream-id, end: stream-id, count: option<integer>) -> result<list<tuple<stream-id, map<string, string-or-bytes>>>, error-code>;

  /// Returns messages from multiple streams with IDs greater than the ones requested.
  ///
  /// With `block`, returns none when the timeout passed. The connection waits too, replies to
  /// commands sent after it on the connection wait behind it. Use a connection of your own.
  ///
  /// XREAD [ COUNT count ] [ BLOCK milliseconds ] STREAMS key [ key ... ] ID [ ID ... ]
  /// https://valkey.io/commands/xread/
  @since(version = 0.3.0-dev)
  xread: async func(connection: borrow<connection>, count: option<integer>, block: option<duration-milliseconds>, keys: list<string>, ids: list<stream-id>) -> result<option<map<string, list<tuple<stream-id, map<string, string-or-bytes>>>>>, error-code>;

  /// Returns new or historical messages from a stream for a consumer in a group.
  ///
  /// The fields of an entry are none when it was deleted after it was delivered, e.g. when
  /// reading the pending entries with the ID `0`.
  ///
  /// With `block`, returns none when the timeout passed. The connection waits too, replies to
  /// commands sent after it on the connection wait behind it. Use a connection of your own.
  ///
  /// XREADGROUP GROUP group consumer [ COUNT count ] [ BLOCK milliseconds ] [ NOACK ] STREAMS key [ key ... ] ID [ ID ... ]
  /// https://valkey.io/commands/xreadgroup/
  @since(version = 0.3.0-dev)
  xreadgroup: async func(connection: borrow<connection>, group: string, consumer: string, count: option<integer>, block: option<duration-milliseconds>, noack: bool, keys: list<string>, ids: list<stream-id>) -> result<option<map<string, list<tuple<stream-id, option<map<string, string-or-bytes>>>>>>, error-code>;

  /// Returns the messages from a stream within a range of IDs in reverse order.
  ///
  /// XREVRANGE key end start [ COUNT count ]
  /// https://valkey.io/commands/xrevrange/
  @since(version = 0.3.0-dev)
  xrevrange: async func(connection: borrow<connection>, key: string, end: stream-id, start: stream-id, count: option<integer>) -> result<list<tuple<stream-id, map<string, string-or-bytes>>>, error-code>;

  /// An internal command for replicating stream values.
  ///
  /// XSETID key last-id [ ENTRIESADDED entries-added ] [ MAXDELETEDID max-deleted-id ]
  /// https://valkey.io/commands/xsetid/
  @since(version = 0.3.0-dev)
  xsetid: async func(connection: borrow<connection>, key: string, last-id: stream-id, entries-added: option<integer>, max-deleted-id: option<stream-id>) -> result<_, error-code>;

  /// Deletes messages from the beginning of a stream.
  ///
  /// XTRIM key 〈 MAXLEN | MINID 〉 [ = | ~ ] threshold [ LIMIT count ]
  /// https://valkey.io/commands/xtrim/
  @since(version = 0.3.0-dev)
  xtrim: async func(connection: borrow<connection>, key: string, trim: stream-trim) -> result<integer, error-code>;

  /// Appends a string to the value of a key.
  ///
  /// APPEND key value
  /// https://valkey.io/commands/append/
  @since(version = 0.3.0-dev)
  append: async func(connection: borrow<connection>, key: string, value: string-or-bytes) -> result<integer, error-code>;

  /// Decrements the integer value of a key by one.
  ///
  /// DECR key
  /// https://valkey.io/commands/decr/
  @since(version = 0.3.0-dev)
  decr: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Decrements the integer value of a key by a number.
  ///
  /// DECRBY key decrement
  /// https://valkey.io/commands/decrby/
  @since(version = 0.3.0-dev)
  decrby: async func(connection: borrow<connection>, key: string, decrement: integer) -> result<integer, error-code>;

  /// Delete key if value matches string.
  ///
  /// DELIFEQ key value
  /// https://valkey.io/commands/delifeq/
  @since(version = 0.3.0-dev)
  delifeq: async func(connection: borrow<connection>, key: string, value: string-or-bytes) -> result<bool, error-code>;

  /// Returns the string value of a key.
  ///
  /// GET key
  /// https://valkey.io/commands/get/
  @since(version = 0.3.0-dev)
  get: async func(connection: borrow<connection>, key: string) -> result<option<string-or-bytes>, error-code>;

  /// Returns the string value of a key after deleting the key.
  ///
  /// GETDEL key
  /// https://valkey.io/commands/getdel/
  @since(version = 0.3.0-dev)
  getdel: async func(connection: borrow<connection>, key: string) -> result<option<string-or-bytes>, error-code>;

  /// Returns the string value of a key after setting its expiration time.
  ///
  /// GETEX key [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST ]
  /// https://valkey.io/commands/getex/
  @since(version = 0.3.0-dev)
  getex: async func(connection: borrow<connection>, key: string, ttl: option<getex-ttl>) -> result<option<string-or-bytes>, error-code>;

  /// Returns a substring of the string stored at a key.
  ///
  /// GETRANGE key start end
  /// https://valkey.io/commands/getrange/
  @since(version = 0.3.0-dev)
  getrange: async func(connection: borrow<connection>, key: string, start: integer, end: integer) -> result<string-or-bytes, error-code>;

  /// Returns the previous string value of a key after setting it to a new value.
  ///
  /// GETSET key value
  /// https://valkey.io/commands/getset/
  @since(version = 0.3.0-dev)
  getset: async func(connection: borrow<connection>, key: string, value: string-or-bytes) -> result<option<string-or-bytes>, error-code>;

  /// Increments the integer value of a key by one.
  ///
  /// INCR key
  /// https://valkey.io/commands/incr/
  @since(version = 0.3.0-dev)
  incr: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Increments the integer value of a key by a number.
  ///
  /// INCRBY key increment
  /// https://valkey.io/commands/incrby/
  @since(version = 0.3.0-dev)
  incrby: async func(connection: borrow<connection>, key: string, increment: integer) -> result<integer, error-code>;

  /// Increments the floating point value of a key by a number.
  ///
  /// INCRBYFLOAT key increment
  /// https://valkey.io/commands/incrbyfloat/
  @since(version = 0.3.0-dev)
  incrbyfloat: async func(connection: borrow<connection>, key: string, increment: double) -> result<double, error-code>;

  /// Finds the longest common substring.
  ///
  /// See also `lcs-len` and `lcs-idx`.
  ///
  /// LCS key1 key2
  /// https://valkey.io/commands/lcs/
  @since(version = 0.3.0-dev)
  lcs: async func(connection: borrow<connection>, key1: string, key2: string) -> result<string-or-bytes, error-code>;

  /// Finds the longest common substring.
  ///
  /// The `LEN` form, the length only.
  ///
  /// See also `lcs` and `lcs-idx`.
  ///
  /// LCS key1 key2 LEN
  /// https://valkey.io/commands/lcs/
  @since(version = 0.3.0-dev)
  lcs-len: async func(connection: borrow<connection>, key1: string, key2: string) -> result<integer, error-code>;

  /// Finds the longest common substring.
  ///
  /// The `IDX` form, the ranges of the matches.
  ///
  /// See also `lcs` and `lcs-len`.
  ///
  /// LCS key1 key2 IDX [ MINMATCHLEN min-match-len ] [ WITHMATCHLEN ]
  /// https://valkey.io/commands/lcs/
  @since(version = 0.3.0-dev)
  lcs-idx: async func(connection: borrow<connection>, key1: string, key2: string, min-match-len: option<integer>, with-match-len: bool) -> result<lcs-idx-reply, error-code>;

  /// Atomically returns the string values of one or more keys.
  ///
  /// MGET key [ key ... ]
  /// https://valkey.io/commands/mget/
  @since(version = 0.3.0-dev)
  mget: async func(connection: borrow<connection>, keys: list<string>) -> result<list<option<string-or-bytes>>, error-code>;

  /// Atomically creates or modifies the string values of one or more keys.
  ///
  /// MSET key value [ key value ... ]
  /// https://valkey.io/commands/mset/
  @since(version = 0.3.0-dev)
  mset: async func(connection: borrow<connection>, keys-and-values: list<tuple<string, string-or-bytes>>) -> result<_, error-code>;

  /// Atomically creates or modifies the string values of one or more keys, and optionally set their expiration.
  ///
  /// MSETEX numkeys key value [ key value ... ] [ NX | XX ] [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ]
  /// https://valkey.io/commands/msetex/
  @since(version = 0.3.0-dev)
  msetex: async func(connection: borrow<connection>, keys-and-values: list<tuple<string, string-or-bytes>>, precondition: option<msetex-precondition>, ttl: option<msetex-ttl>) -> result<bool, error-code>;

  /// Atomically modifies the string values of one or more keys only when all keys don't exist.
  ///
  /// MSETNX key value [ key value ... ]
  /// https://valkey.io/commands/msetnx/
  @since(version = 0.3.0-dev)
  msetnx: async func(connection: borrow<connection>, keys-and-values: list<tuple<string, string-or-bytes>>) -> result<bool, error-code>;

  /// Sets both string value and expiration time in milliseconds of a key.
  ///
  /// PSETEX key milliseconds value
  /// https://valkey.io/commands/psetex/
  @since(version = 0.3.0-dev)
  psetex: async func(connection: borrow<connection>, key: string, milliseconds: duration-milliseconds, value: string-or-bytes) -> result<_, error-code>;

  /// Sets the string value of a key, ignoring its type.
  ///
  /// Returns false when the precondition is not met, the key is unchanged.
  ///
  /// See also `set-get`.
  ///
  /// SET key value [ NX | XX | IFEQ comparison-value | IFNE comparison-not-equal ] [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ]
  /// https://valkey.io/commands/set/
  @since(version = 0.3.0-dev)
  set: async func(connection: borrow<connection>, key: string, value: string-or-bytes, precondition: option<set-precondition>, ttl: option<set-ttl>) -> result<bool, error-code>;

  /// Sets the string value of a key, ignoring its type.
  ///
  /// The `GET` form, returning the previous value, none when the key did not exist.
  ///
  /// See also `set`.
  ///
  /// SET key value [ NX | XX | IFEQ comparison-value | IFNE comparison-not-equal ] GET [ EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL ]
  /// https://valkey.io/commands/set/
  @since(version = 0.3.0-dev)
  set-get: async func(connection: borrow<connection>, key: string, value: string-or-bytes, precondition: option<set-precondition>, ttl: option<set-ttl>) -> result<option<string-or-bytes>, error-code>;

  /// Sets the string value and expiration time of a key.
  ///
  /// SETEX key seconds value
  /// https://valkey.io/commands/setex/
  @since(version = 0.3.0-dev)
  setex: async func(connection: borrow<connection>, key: string, seconds: duration-seconds, value: string-or-bytes) -> result<_, error-code>;

  /// Sets the string value of a key only when the key doesn't exist.
  ///
  /// SETNX key value
  /// https://valkey.io/commands/setnx/
  @since(version = 0.3.0-dev)
  setnx: async func(connection: borrow<connection>, key: string, value: string-or-bytes) -> result<bool, error-code>;

  /// Overwrites a part of a string value with another by an offset.
  ///
  /// SETRANGE key offset value
  /// https://valkey.io/commands/setrange/
  @since(version = 0.3.0-dev)
  setrange: async func(connection: borrow<connection>, key: string, offset: u32, value: string-or-bytes) -> result<integer, error-code>;

  /// Returns the length of a string value.
  ///
  /// STRLEN key
  /// https://valkey.io/commands/strlen/
  @since(version = 0.3.0-dev)
  strlen: async func(connection: borrow<connection>, key: string) -> result<integer, error-code>;

  /// Returns a substring from a string value.
  ///
  /// SUBSTR key start end
  /// https://valkey.io/commands/substr/
  @since(version = 0.3.0-dev)
  substr: async func(connection: borrow<connection>, key: string, start: integer, end: integer) -> result<string-or-bytes, error-code>;
}