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.
replaceforREPLACE, and a choice of keywords is an enum or a variant, e.g.list-sideforLEFT | RIGHT. - Durations and points in time are records named for their unit, e.g.
duration-secondsandunix-time-milliseconds. - Keys, fields, patterns and names are
string. Values, members and payloads arestring-or-bytes, a reply that is not UTF-8 isbytes. Values that are binary by nature, like the serialized values of DUMP and RESTORE, arebytes. A reply where astringis 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
0or1is 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-replyfor TTL's-2and-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
startcursor and resumes with the one it returned, none once it is complete. - An error reply fails with a
servererror. Arguments the client rejects, and replies it cannot convert, fail with aclienterror. - 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
new: 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-devEstablishes a connection over a transport.
repliesare the values the transport receives from the server, andclosedresolves when the transport closes, tookfor a graceful close or to the error otherwise, seetcp.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 theauthandclient-nameofopts, 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 ofoptsis applied before the connection is returned.It then reports the library to the server,
CLIENT SETINFO LIB-NAME componentized:valkeyandLIB-VERwith the version of the package, ignoring an error from a server that does not know CLIENT SETINFO. They survivereset,client-setinforeplaces them.Async so the connection keeps working between commands after it returns, e.g. to read push messages and to send keep-alive pings.
server-properties: func() -> list<tuple<string, resp-value>>since 0.3.0-devThe server's properties from the reply to HELLO, e.g.
server,versionandmode.exchange: async func( command: list<string-or-bytes>, ) -> result<resp-value, error-code>since 0.3.0-devSends 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, withexchange-all,emitandtransaction.RESET, HELLO and CLIENT REPLY always fail with a client error. See
resetandserver-properties, CLIENT REPLY would stop replies from pairing with commands, seeemit.A command has at least one word, an empty command fails with a client error.
exchange-all: async func( commands: list<list<string-or-bytes>>, ) -> list<result<resp-value, error-code>>since 0.3.0-devSends 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.emit: async func( command: list<string-or-bytes>, ) -> result<_, error-code>since 0.3.0-devSends 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.
watch: async func(keys: list<string>) -> result<_, error-code>since 0.3.0-devMarks 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.
unwatch: async func() -> result<_, error-code>since 0.3.0-devForgets all the watched keys.
UNWATCH https://valkey.io/commands/unwatch/
transaction: async func( commands: list<list<string-or-bytes>>, ) -> result<option<list<resp-value>>, error-code>since 0.3.0-devRuns 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/
subscription: func() -> result<subscription, error-code>since 0.3.0-devA 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
exchangeand the like fail with a client error, so the server's subscriptions stay in step with the connection's. Subscriptions made withexchangebefore are unsupported. They may keep delivering todead-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 withexchange.dead-letters: func() -> stream<resp-value>since 0.3.0-devThe 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.
reset: async func() -> result<_, error-code>since 0.3.0-devResets 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 3with theauthandclient-namethe connection was established with, with no other command sent between them.server-propertiesthen 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/
set-keep-alive: func(interval: option<duration-milliseconds>)since 0.3.0-devSends PING when no command has been sent and no reply is outstanding for
interval,nonedisables 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 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:stringClient errors are semantic issues with input/output values, e.g. a reply that does not have the shape the command expects.
resp:resp-errorRESP errors are encoding issues converting values to/from bytes.
server:string-or-bytesServer 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.
laggedThe 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 variant resp-valuesince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
string:stringerror:stringinteger:integerbulk-string:bytesarray:list<resp-nested-value>nullboolean:booldouble:doublebig-number:stringbulk-error:bytesverbatim-string:tuple<string, string>map:list<tuple<resp-nested-value, resp-nested-value>>set:list<resp-nested-value>push:list<resp-nested-value>
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.
startStarts a new scan, the cursor
0.resume:stringContinues a scan from the opaque cursor the previous call returned,
0fails with a client error, usestart.
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.
nxSet expiration only when the field has no expiration.
xxSet expiration only when the field has an existing expiration.
gtSet expiration only when the new expiration is greater than current one.
ltSet 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-met0: the specified NX | XX | GT | LT condition has not been met.
applied1: the expiration time was applied.
zero-seconds2: 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-met0: the specified NX | XX | GT | LT condition has not been met.
applied1: the expiration time was applied.
zero-seconds2: 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-met0: the specified NX | XX | GT | LT condition has not been met.
applied1: the expiration time was applied.
zero-seconds2: 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-met0: the specified NX | XX | GT | LT condition has not been met.
applied1: the expiration time was applied.
zero-seconds2: 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-secondsThe 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-secondsThe 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-millisecondsThe 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-millisecondsThe 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-secondsThe 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-secondsThe 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-millisecondsThe 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-millisecondsThe 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.
allowedThe user may run the command.
denied:stringThe 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:integerThe number of events like this one, within 60 seconds of each other.
reason:stringWhat was denied, e.g.
command,key,channelorauth.context:stringWhere it was denied, e.g.
toplevel,multiorlua.object:stringThe command, key or channel that was denied.
username:stringage-seconds:doubleThe seconds since the latest of these events.
client-info:stringThe 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.
scheduleSCHEDULE: saves once the rewrite of the append-only file in progress is done.cancelCANCEL: 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.
normalnormalprimarymaster: the connection to the primary of a replica.replicareplicapubsubpubsub
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-typeTYPEuser:stringUSER usernameaddr:stringADDR ip:port: the address of the client.laddr:stringLADDR ip:port: the address of the server the client connected to.skipme:boolSKIPME YES | NO: whether to skip this connection, yes by default for CLIENT KILL.maxage:duration-secondsMAXAGE: connections older than the time.name:stringNAMEidle:duration-secondsIDLE: connections idle for at least the time.flags:stringFLAGS: connections with all the flags, e.g.N.lib-name:stringLIB-NAMElib-ver:stringLIB-VERdb:integerDBcapa:stringCAPA: connections with the capability, e.g.redirect.ip:stringIPnot-id:list<integer>NOT-ID client-id [ client-id ... ]not-type:client-typeNOT-TYPEnot-user:stringNOT-USERnot-addr:stringNOT-ADDRnot-laddr:stringNOT-LADDRnot-name:stringNOT-NAMEnot-flags:stringNOT-FLAGSnot-lib-name:stringNOT-LIB-NAMEnot-lib-ver:stringNOT-LIB-VERnot-db:integerNOT-DBnot-capa:stringNOT-CAPAnot-ip:stringNOT-IP
use enum client-pause-modesince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
Which commands CLIENT PAUSE suspends.
writeWRITE: commands that may write.allALL: 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.
timeoutTIMEOUT: as if the command timed out, the default.errorERROR: with anUNBLOCKEDerror.
use variant cluster-bumpepoch-resultsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
The outcome of CLUSTER BUMPEPOCH.
use enum cluster-failover-modesince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
How CLUSTER FAILOVER fails over.
forceFORCE: without the agreement of the primary, which may be down.takeoverTAKEOVER: 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.
importIMPORT: to this node.exportEXPORT: 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:stringThe ID of the migration.
operation:cluster-getslotmigrations-operationslot-ranges:list<tuple<u16, u16>>The ranges of slots, start and end both included.
target-node:stringThe ID of the node the slots move to.
source-node:stringThe ID of the node the slots move from.
create-time:unix-time-secondslast-update-time:unix-time-secondslast-ack-time:unix-time-secondsstate:stringThe state of the migration, for people to read.
message:stringMore details of the state, for people to read.
cow-size:integerThe 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:stringThe 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.
hardHARD: also generates a new node ID and resets the epochs.softSOFT: 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:stringIMPORTING node-id: importing the slot from the node.migrating:stringMIGRATING node-id: migrating the slot to the node.node:stringNODE node-id: assigned to the node.stableSTABLE: 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.
slowslow: commands that took longer thancommandlog-execution-slower-than.large-requestlarge-request: commands larger thancommandlog-request-larger-than.large-replylarge-reply: replies larger thancommandlog-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:integerThe ID of the entry, unique until the server restarts.
timestamp:unix-time-secondsWhen the command ran.
value:integerThe 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:stringThe client's address,
ip:port.client-name:stringThe 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:integerThe ID of the entry, unique until the server restarts.
timestamp:unix-time-secondsWhen the command ran.
value:integerThe 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:stringThe client's address,
ip:port.client-name:stringThe 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:stringport:u16force:boolFORCE: 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.
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.
event:stringtimestamp:unix-time-secondsWhen the latest sample was taken.
latest:duration-millisecondsmax:duration-millisecondsThe highest latency since the server started, or the event was reset.
sum:duration-millisecondsThe sum of the latencies of the samples.
count:integerThe number of samples.
use record module-list-entrysince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
A loaded module, see module-list.
name:stringver:integerThe module's version.
path:stringThe 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:stringport:u16offset:integerThe 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.
offset:integerThe primary's replication offset.
replicas:list<role-primary-replica>
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:stringprimary-port:u16state:stringThe state of replication, e.g.
connected,connectingorsync.offset:integerThe 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-primarymasterreplica:role-replicaslavesentinel: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.
nowNOW: does not wait for lagging replicas.forceFORCE: ignores errors that would prevent the shutdown, e.g. failing to save.safeSAFE: refuses to shut down while it would lose the cluster's quorum of primaries.failoverFAILOVER: 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.
nosaveNOSAVE: does not save, even with save points configured.saveSAVE: 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:stringrules:list<acl-rule>The user's rules, as the server normalized them, e.g.
allkeysis~*. Applied withacl-setuser, afterreset, 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-ruleThe keys the user may access.
channel:acl-channel-ruleThe Pub/Sub channels the user may access.
command:acl-command-ruleThe commands the user may call.
db:acl-db-ruleThe databases the user may access.
user:acl-user-ruleThe user itself, e.g. whether it is enabled and its passwords.
other:stringA 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-ruleThe keys the selector permits access to.
channel:acl-channel-ruleThe Pub/Sub channels the selector permits access to.
command:acl-command-ruleThe commands the selector permits.
db:acl-db-ruleThe databases the selector permits access to.
other:stringA 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 asadd.allallkeys: allows access to all keys, an alias for~*.resetresetkeys: 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.allallchannels: allows access to all Pub/Sub channels, an alias for&*.resetresetchannels: 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.selectwith0.allallcommands: 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.resetnocommands: 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.allalldbs: allows access to all databases.resetresetdbs: 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.
onon: enables the user, it is possible to authenticate as this user.offoff: disables the user, it is no longer possible to authenticate as this user, connections already authenticated keep working.nopassnopass: removes all the user's passwords, any password then authenticates as the user.sanitize-payloadsanitize-payload: validates the payloads of the user's RESTORE commands, the default.skip-sanitize-payloadskip-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.clearselectorsclearselectors: removes all the user's selectors.resetreset: 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.
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:u8i1toi64: a signed integer of the width in bits.unsigned:u8u1tou63: 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:u64The 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.
wrapWRAP: wraps around, the default.satSAT: saturates at the minimum or maximum.failFAIL: 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.
encoding:bitfield-encodingoffset:bitfield-offset
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.
encoding:bitfield-encodingoffset:bitfield-offset
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.
encoding:bitfield-encodingoffset:bitfield-offsetvalue:s64
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.
encoding:bitfield-encodingoffset:bitfield-offsetincrement:s64
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.
get:bitfield-getGET encoding offsetset:tuple<option<bitfield-overflow>, bitfield-set>[ OVERFLOW WRAP | SAT | FAIL ] SET encoding offset valueincrby:tuple<option<bitfield-overflow>, bitfield-incrby>[ OVERFLOW WRAP | SAT | FAIL ] INCRBY encoding offset increment
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>ANDor:list<string>ORxor:list<string>XORnot:stringNOT: of a single key.
use variant command-key-spec-begin-searchsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
connection commands
How a key spec finds the first key, see command-key-spec.
index:integerindex: the argument at the index.keyword:command-key-spec-keywordkeyword: the argument after the keyword.unknownunknown: the keys cannot be found from the arguments alone.
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:stringstartfrom:integerThe 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.
range:command-key-spec-rangerange: a range of arguments.keynum:command-key-spec-keynumkeynum: the number of keys is an argument.unknownunknown: the keys cannot be found from the arguments alone.
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.
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.
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.
notes:option<string>flags:list<string>How the command uses the keys, e.g.
RW,accessandupdate.begin-search:command-key-spec-begin-searchfind-keys:command-key-spec-find-keys
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:stringThe command's name, e.g.
get, or for a subcommand,config|get.arity:integerThe number of arguments, the name included, the minimum when negative.
flags:list<string>The command's flags, e.g.
readonlyandfast.first-key:integerThe index of the first key, 0 for none.
last-key:integerThe index of the last key, from the end when negative.
step:integerThe 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:stringThe command's name, e.g.
get, or for a subcommand,config|get.arity:integerThe number of arguments, the name included, the minimum when negative.
flags:list<string>The command's flags, e.g.
readonlyandfast.first-key:integerThe index of the first key, 0 for none.
last-key:integerThe index of the last key, from the end when negative.
step:integerThe 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.
stringstringintegerintegerdoubledoublekeykey: a key, seekey-spec-index.patternpattern: a glob-style pattern.unix-timeunix-timepure-tokenpure-token: the token alone, without a value.oneofoneof: one of the arguments it contains.blockblock: the arguments it contains, together.other:stringA 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
oneoforblockargument containing this one, in the command's arguments, none at the top level.name:stringtype:command-docs-argument-typedisplay-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 apure-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,multipleandmultiple_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:stringThe command's name, e.g.
get, or for a subcommand,config|get.summary:stringsince:stringThe version that added the command.
group:stringThe 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.
deprecatedorsyscmd.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:stringLIB-NAME: the name of the library, e.g.valkey-wasm.lib-ver:stringLIB-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.
optinOPTIN: none, only those of commands after CLIENT CACHING YES.optoutOPTOUT: 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: withbcast, only notifies about keys with the prefixes.bcast:boolBCAST: notifies about every change of the keys with the prefixes, read or not.mode:option<client-tracking-mode>noloop:boolNOLOOP: 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-redirected0: tracking is on, the notifications are not redirected.
redirected:integerThe 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,optinornoloop.redirect:client-trackinginfo-redirectWhere 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:stringMODULE module-name: the commands of the module.aclcat:stringACLCAT category: the commands in the ACL category.pattern:stringPATTERN 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
use enum geo-unitsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
A unit of distance.
mm: meters.kmkm: kilometers.ftft: feet.mimi: 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.
nxOnly add new members, never update existing ones.
xxOnly 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.
member:string-or-bytesFROMMEMBER member: the position of a member of the index.lonlat:geo-coordinatesFROMLONLAT longitude latitude
use record geosearch-radiussince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
BYRADIUS: a circle around the center.
from:geosearch-fromradius:doubleunit:geo-unit
use record geosearch-boxsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
BYBOX: a rectangle around the center.
from:geosearch-fromwidth:doubleheight:doubleunit:geo-unit
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 unitbox:geosearch-box[ FROMMEMBER member | FROMLONLAT longitude latitude ] BYBOX width height unitpolygon: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 unitbox:geosearch-box[ FROMMEMBER member | FROMLONLAT longitude latitude ] BYBOX width height unitpolygon: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:integerany:boolANY: 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:integerany:boolANY: 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.
withcoordWITHCOORD: the position.withdistWITHDIST: the distance from the center.withhashWITHHASH: 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-bytesdistance: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.
removed1: 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.
nxOnly set the fields when the hash does not exist.
xxOnly 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.
fnxOnly set the fields when none of them exist.
fxxOnly 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.
stringstringlistlistsetsetzsetzset: a sorted set.hashhashstreamstreamother:stringThe 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.
copyCOPY: keeps the keys in this instance.replaceREPLACE: 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:stringAUTH passwordusername-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.
leftLEFT: the head, the first element.rightRIGHT: 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.
beforeBEFORE: in front of the pivot.afterAFTER: behind the pivot.
use variant linsert-resultsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
The outcome of LINSERT.
inserted:integerThe element was inserted, the length of the list after it.
no-such-key0: 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.
asyncASYNCsyncSYNC
use record function-list-functionsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
A function of a library.
name:stringdescription: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:stringengine:stringThe 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:stringcommand:list<string>The command and its arguments that called the function.
duration:duration-millisecondsHow 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.
running-script:option<function-stats-running>None when no function is running.
engines:map<string, function-stats-engine>The statistics of each engine, by name.
use record limitsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
A range of a sorted result, LIMIT offset count.
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, ornosortto 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:boolALPHA: 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, ornosortto 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:boolALPHA: sorts lexicographically, rather than numerically.
use enum sort-ordersince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
ascascending, smallest to largest.
descdescending, 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.
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 withREV.
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.
minThe members with the lowest scores.
maxThe 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.
minThe members with the lowest scores.
maxThe 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.
sumThe sum of the weighted scores, the default.
minThe lowest weighted score.
maxThe 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.
rank:tuple<integer, integer>Positions, both included, negative from the end.
score:tuple<score-bound, score-bound>BYSCORE: the members with scores in the range.lex:tuple<lex-bound, lex-bound>BYLEX: the members in the range, for members of equal score.
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.
rank:tuple<integer, integer>Positions, both included, negative from the end.
score:tuple<score-bound, score-bound>BYSCORE: the members with scores in the range.lex:tuple<lex-bound, lex-bound>BYLEX: the members in the range, for members of equal score.
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.
rank:tuple<integer, integer>Positions, both included, negative from the end.
score:tuple<score-bound, score-bound>BYSCORE: the members with scores in the range.
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.
nxOnly add new members, never update existing ones.
xxOnly 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.
gtOnly update when the new score is greater than the current one.
ltOnly 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-maxlenEvicts entries as long as the stream's length exceeds the specified threshold, where threshold is a positive integer.
minid:stream-trim-minidEvicts 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:integerThe maximum number of entries kept.
limit:option<integer>The maximum number of entries evicted, only with nearly exact trimming,
0for 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-idThe lowest ID kept.
limit:option<integer>The maximum number of entries evicted, only with nearly exact trimming,
0for 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 trimmingmearly-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:boolFORCE: 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:stringThe consumer's name.
pending:integerThe number of entries pending for the consumer.
idle:duration-millisecondsThe 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:stringThe group's name.
consumers:integerThe number of consumers in the group.
pending:integerThe number of entries in the group's pending entries list (PEL), delivered but not acknowledged.
last-delivered-id:stream-idThe 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:integerThe number of entries in the stream.
radix-tree-keys:integerThe number of keys in the radix tree storing the stream.
radix-tree-nodes:integerThe number of nodes in the radix tree storing the stream.
groups:integerThe 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:integerThe 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:integerThe number of entries in the stream.
radix-tree-keys:integerThe number of keys in the radix tree storing the stream.
radix-tree-nodes:integerThe 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:integerThe 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:stringThe group's name.
last-delivered-id:stream-idThe 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:integerThe 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:stringThe consumer's name.
seen-time:unix-time-millisecondsWhen 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:integerThe 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:integerThe 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-idThe ID of the message.
name:stringThe 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-millisecondsThe number of milliseconds that elapsed since the last time this message was delivered to this consumer.
delivery-count:integerThe 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-secondsSet the specified expire time, in seconds.
px:duration-millisecondsSet the specified expire time, in milliseconds.
exat:unix-time-secondsSet the specified Unix time at which the key will expire, in seconds.
pxat:unix-time-millisecondsSet the specified Unix time at which the key will expire, in milliseconds.
persistRemove 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-secondsSet the specified expire time, in seconds.
px:duration-millisecondsSet the specified expire time, in milliseconds.
exat:unix-time-secondsSet the specified Unix time at which the key will expire, in seconds.
pxat:unix-time-millisecondsSet the specified Unix time at which the key will expire, in milliseconds.
persistRemove 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:integerThe 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.
use variant msetex-preconditionsince 0.3.0-dev
from componentized:valkey/types@0.3.0-dev
The condition for setting the keys, see msetex.
nxOnly set the keys if all of them do not already exist.
xxOnly 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-secondsSet the specified expire time, in seconds.
px:duration-millisecondsSet the specified expire time, in milliseconds.
exat:unix-time-secondsSet the specified Unix time at which the key will expire, in seconds.
pxat:unix-time-millisecondsSet the specified Unix time at which the key will expire, in milliseconds.
keepttlRetain 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.
nxOnly set the key if it does not already exist.
xxOnly set the key if it already exists.
ifeq:string-or-bytesSet the key if the comparison value matches the existing value.
ifne:string-or-bytesSet 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-secondsSet the specified expire time, in seconds.
px:duration-millisecondsSet the specified expire time, in milliseconds.
exat:unix-time-secondsSet the specified Unix time at which the key will expire, in seconds.
pxat:unix-time-millisecondsSet the specified Unix time at which the key will expire, in milliseconds.
keepttlRetain 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-secondsSet the specified expire time, in seconds.
px:duration-millisecondsSet the specified expire time, in milliseconds.
exat:unix-time-secondsSet the specified Unix time at which the key will expire, in seconds.
pxat:unix-time-millisecondsSet the specified Unix time at which the key will expire, in milliseconds.
keepttlRetain 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:stringutf-8 decoded bytes.
bytes:bytesbytes 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.
expire-in:duration-millisecondsttl: the key expires after the duration.expire-at:unix-time-millisecondsttlwithABSTTL: the key expires at the time.
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.
flushFLUSH: deletes them first.appendAPPEND: keeps them, failing when a library of the same name is loaded.replaceREPLACE: keeps them, replacing those with a library of the same name.
Functions
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
acl-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/
bgrewriteaof: 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/
bgsave: 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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
cluster-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/
commandlog-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/
commandlog-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/
commandlog-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/
config-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/
config-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/
config-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/
config-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/
failover: 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/
lastsave: 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/
latency-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/
latency-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/
latency-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/
latency-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/
latency-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/
latency-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/
module-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/
module-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/
module-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/
module-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/
replicaof: 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/
role: 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/
save: 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/
shutdown: 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/
shutdown-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/
slowlog-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/
slowlog-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/
slowlog-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/
bitcount: 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/
bitfield: 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/
bitfield-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/
bitop: 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/
bitpos: 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/
getbit: 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/
setbit: 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/
asking: 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/
auth: 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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
client-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/
command: 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/
command-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/
command-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/
command-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/
command-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/
command-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/
command-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/
echo: 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/
ping: 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/
readonly: 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/
readwrite: 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/
select: 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/
wait: 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/
waitaof: 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/
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>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/
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>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/
geohash: 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/
geopos: 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/
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>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/
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>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/
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>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/
hdel: 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/
hexists: 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/
hexpire: 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/
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>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/
hexpiretime: 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/
hget: 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/
hgetall: 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/
hgetdel: 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/
hgetex: 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/
hincrby: 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/
hincrbyfloat: 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/
hkeys: 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/
hlen: 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/
hmget: 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/
hmset: 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/
hpersist: 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/
hpexpire: 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/
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>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/
hpexpiretime: 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/
hpttl: 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/
hrandfield: 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/
hrandfield-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/
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>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/
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>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/
hset: 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/
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>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/
hsetnx: 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/
hstrlen: 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/
httl: 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/
hvals: 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/
pfadd: 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/
pfcount: 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/
pfmerge: 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/
cluster-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/
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>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/
copy: 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/
dbsize: 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/
del: 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/
dump: 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/
exists: 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/
expire: 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/
expireat: 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/
expiretime: 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/
flushall: 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/
flushdb: 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/
keys: 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/
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>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/
move: 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/
object-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/
object-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/
object-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/
object-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/
persist: 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/
pexpire: 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/
pexpireat: 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/
pexpiretime: 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/
pttl: 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/
randomkey: 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/
rename: 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/
renamenx: 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/
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>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/
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>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/
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>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/
swapdb: 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/
touch: 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/
ttl: 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/
type: 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/
unlink: async func(
connection: borrow<connection>,
keys: list<string>,
) -> result<integer, error-code>since 0.3.0-dev
Asynchronously deletes one or more keys.
UNLINK key [ key ... ] https://valkey.io/commands/unlink/
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>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/
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>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/
blpop: 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/
brpop: 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/
brpoplpush: 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/
lindex: 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/
linsert: 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/
llen: 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/
lmove: 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/
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>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/
lpop: 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/
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>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/
lpush: 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/
lpushx: 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/
lrange: 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/
lrem: 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/
lset: 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/
ltrim: 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/
rpop: 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/
rpoplpush: 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/
rpush: 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/
rpushx: 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/
publish: 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/
pubsub-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/
pubsub-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/
pubsub-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/
pubsub-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/
pubsub-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/
spublish: 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/
eval: 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/
eval-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/
evalsha: 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/
evalsha-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/
fcall: 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/
fcall-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/
function-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/
function-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/
function-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/
function-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/
function-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/
function-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/
function-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/
function-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/
script-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/
script-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/
script-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/
script-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/
script-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/
sadd: 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/
scard: 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/
sdiff: 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/
sdiffstore: 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/
sinter: 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/
sintercard: 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/
sinterstore: 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/
sismember: 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/
sismember-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/
smembers: 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/
smismember: 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/
smove: 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/
spop: 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/
srandmember: 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/
srem: 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/
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>since 0.3.0-dev
Iterates over members of a set.
SSCAN key cursor [ MATCH pattern ] [ COUNT count ] https://valkey.io/commands/sscan/
sunion: 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/
sunionstore: 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/
sort: 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/
sort-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/
sort-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/
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>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/
bzpopmax: 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/
bzpopmin: 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/
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>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/
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>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/
zcard: 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/
zcount: 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/
zdiff: 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/
zdiff-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/
zdiffstore: 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/
zincrby: 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/
zinter: 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/
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>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/
zintercard: 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/
zinterstore: 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/
zlexcount: 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/
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>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/
zmscore: 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/
zpopmax: 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/
zpopmin: 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/
zrandmember: 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/
zrandmember-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/
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>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/
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>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/
zrangestore: 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/
zrank: 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/
zrank-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/
zrem: 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/
zremrangebylex: 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/
zremrangebyrank: 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/
zremrangebyscore: 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/
zrevrank: 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/
zrevrank-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/
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>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/
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>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/
zscore: 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/
zunion: 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/
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>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/
zunionstore: 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/
xack: 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/
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>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/
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>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/
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>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/
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>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/
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>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/
xdel: 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/
xgroup-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/
xgroup-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/
xgroup-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/
xgroup-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/
xgroup-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/
xinfo-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/
xinfo-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/
xinfo-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/
xinfo-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/
xlen: 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/
xpending: 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/
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>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/
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>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/
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>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/
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>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/
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>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/
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>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/
xtrim: 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/
append: 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/
decr: 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/
decrby: 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/
delifeq: 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/
get: 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/
getdel: 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/
getex: 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/
getrange: 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/
getset: 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/
incr: 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/
incrby: 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/
incrbyfloat: 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/
lcs: 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/
lcs-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/
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>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/
mget: 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/
mset: 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/
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>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/
msetnx: 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/
psetex: 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/
set: 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/
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>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/
setex: 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/
setnx: 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/
setrange: 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/
strlen: 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/
substr: 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>;
}