moonredis
518 items · moonbitstack/moonredis
Types 54
pub(all) struct AggregateOptions {
verbatim : Bool
load : Array[String]
group_by : Array[String]
reducers : Array[Reducer]
apply : Array[(String, String)]
sort_by : Array[SortKey]
offset : Int64
limit : Int64
filter : String?
params : Array[(String, Bytes)]
dialect : Int32?
timeout : Int64?
cursor_count : Int64?
max_idle : Int64?
}The options FT.AGGREGATE takes besides the index and the query.
pub(all) struct AggregateResult {
total : Int64
rows : Array[Array[(String, FieldValue)]]
cursor : Int64?
}What FT.AGGREGATE and FT.CURSOR READ answer: the rows, and the cursor id to read more with.
pub struct Client {
conn : &RedisConn
}A redis client over a RedisConn: the typed command families are methods on it, and command is the general entry when a caller wants to send raw argument bytes.
pub(all) struct ClientOptions {
host : String
port : Int32
username : String?
password : String?
db : Int32
protocol : Protocol
tls : @tls.Client?
connect_timeout : Int64
read_timeout : Int64
write_timeout : Int64
pool : PoolOptions
retry : RetryOptions
tracking : TrackingOptions
}Everything needed to reach and speak to a redis: the endpoint and credentials, the protocol, the timeouts, and the pool, retry and tracking policies.
pub struct ClusterClient {
nodes : Map[String, &RedisConn]
mut topology : ClusterTopology
limit : Int32
dial : (async (String) -> &RedisConn raise RedisError)?
}A cluster-aware client: it routes a command to the node owning its key and follows MOVED and ASK redirects. Built from a connection per node address and the topology.
A redirect can name a node it was not built with, after a reshard or a failover. dial opens a connection to such a node; without it that redirect is a Connection error.
pub struct ClusterSlot {
start : Int32
end : Int32
node : String
}A contiguous range of slots owned by one node, named by host:port.
pub struct ClusterTopology {
slots : Array[ClusterSlot]
}The slot-to-node map the client routes with.
pub(all) struct CompactionRule {
destination : String
bucket : Int64
aggregator : String
}A compaction rule: the series this one rolls into, how wide each bucket is, and how the bucket is reduced.
pub struct FakeConn {
queue : Array[@resp.RespValue]
mut at : Int32
run : (Array[Bytes]) -> @resp.RespValue
sent : Array[Array[Bytes]]
}A redis connection backed by a scripted reply queue and, once the queue is spent, a handler keyed on the command sent. The tests drive the whole command surface through it without a socket, and the cluster and sentinel routing tests feed it handlers that mimic a node.
pub(all) enum FieldValue {
Text(String)
Integer(Int64)
Number(Double)
Null
}One value in a search or aggregate reply: the fields of a document as text, and the computed values of an aggregation as the type the server sent.
pub(all) enum Fpha {
Bf16
Fp16
Fp32
Fp64
}The float array storage JSON.SET may be told to use: FPHA BF16, FP16, FP32 or FP64.
pub(all) enum Fusion {
Rrf
Linear
}How a hybrid query fuses the two branches.
pub(all) struct GeoFilter {
field : String
longitude : Double
latitude : Double
radius : Double
unit : String
}A distance a document's geo field must fall within.
pub(all) struct HybridOptions {
knn : Int64
ef_runtime : Int64?
radius : (Double, Double)?
fusion : Fusion?
fusion_params : (Double, Double)?
load : Array[String]
sort_by : SortKey?
offset : Int64
limit : Int64
filter : String?
params : Array[(String, Bytes)]
timeout : Int64?
}The options FT.HYBRID takes besides the index, the text query and the vector.
pub(all) struct IndexField {
identifier : String
attribute : String
type_ : String
sortable : Bool
unf : Bool
noindex : Bool
weight : Double
}One indexed field as FT.INFO describes it.
pub(all) struct IndexInfo {
name : String
key_type : String
prefixes : Array[String]
filter : String?
default_score : Double
num_docs : Int64
max_doc_id : Int64
num_terms : Int64
num_records : Int64
indexing : Bool
percent_indexed : Double
indexing_failures : Int64
attributes : Array[IndexField]
}What FT.INFO reports about an index: its size, its schema and its settings.
pub(all) enum IndexKind {
Hash
Json
}What an index is built over.
pub(all) struct Info {
items : Map[String, InfoValue]
}The name/value pairs an INFO reply holds, looked up by name. Redis answers these with a flat array under RESP2 and a map under RESP3; both come back as this.
pub(all) enum InfoValue {
Text(String)
Number(Double)
Flag(Bool)
Missing
}One value in a module's INFO reply: the four shapes those replies use. A key the server did not report reads as Missing rather than raising, because the set of keys grows between versions.
pub struct Message {
kind : String
channel : String
payload : Bytes
pattern : String?
count : Int64
}One frame of the pub/sub stream. kind is the redis frame name (message, subscribe, ...); payload is the message body for a message/smessage frame, and count is the remaining subscription count for a subscribe/unsubscribe frame.
pub(all) struct MultiGetOptions {
with_labels : Bool
select_labels : Array[String]
latest : Bool
}The options a multi-series point query takes.
pub(all) struct MultiRangeOptions {
range : RangeOptions
with_labels : Bool
select_labels : Array[String]
group_by : String?
reduce : String?
exclude_empty : Bool
}The options a multi-series query adds: which labels to carry, and how to group.
pub(all) struct NumericFilter {
field : String
min : String
max : String
}A numeric range a document's field must fall in.
pub struct PendingSummary {
count : Int64
min_id : String?
max_id : String?
consumers : Array[(String, Int64)]
}The summary XPENDING returns for a group: how many pending, the first and last pending ids, and per-consumer pending counts.
pub struct Pipeline {
conn : &RedisConn
queue : Array[Array[Bytes]]
mut transaction : Bool
}A queued batch of commands against one connection. Add commands with add; run them with execute. Set multi first to send them inside MULTI/EXEC.
pub(all) struct PivotRow {
timestamp : Int64
values : Array[Double?]
}One row of a reply pivoted by timestamp: the timestamp and one value per key, None where that key has no sample there.
pub(all) struct PoolOptions {
max_idle : Int32
max_active : Int32
min_idle : Int32
idle_timeout : Int64
health_check : Bool
}The pool a client draws connections from: its size bounds, how long an idle connection lives, and whether a borrowed connection is checked before use.
pub(all) enum Protocol {
Resp2
Resp3
}Which RESP version to negotiate with HELLO. RESP2 is the long-standing wire; RESP3 adds the typed null, boolean, double, map, set and push values and is required for client-side caching.
pub(all) struct RangeOptions {
latest : Bool
filter_by_ts : Array[Int64]
filter_by_value : (Double, Double)?
count : Int64
aggregation : String?
bucket : Int64
align : String?
bucket_timestamp : String?
empty : Bool
}The options a range query takes: paging, filtering, and how to bucket the samples.
pub(all) enum Redirect {
Moved(slot~ : Int32, node~ : String)
Ask(slot~ : Int32, node~ : String)
}Where a cluster node sent a command.
pub(open) trait RedisConn {
async fn execute(Self, Array[Bytes]) -> @resp.RespValue raise RedisError
async fn execute_all(Self, Array[Array[Bytes]]) -> Array[@resp.RespValue] raise RedisError = _
}A live redis connection: it sends an encoded command (an array of argument byte strings) and returns the decoded reply. Implementations own the transport — a real socket speaking RESP, or an in-memory fake. It is open and async so a socket can be one: real redis I/O suspends, and a sealed synchronous trait left every implementation a test double.
pub(all) suberror RedisError {
Reply(String)
Connection(String)
Protocol(String)
Closed
Aborted
}Why a redis call failed: a redis error reply, a transport failure, a closed connection, a reply the client could not interpret as the command promised, or a transaction a watched key changed under.
pub(all) struct Reducer {
function : String
args : Array[String]
as_ : String?
}One REDUCE of an aggregation: a function, its arguments, and the name its result takes.
pub struct RetryConn {
mut inner : &RedisConn
retry : RetryOptions
dial : (async () -> &RedisConn raise RedisError)?
wait : (async (Int64) -> Unit noraise)?
}A connection that retries transport failures up to retry.attempts times, leaving a redis error reply to surface at once. A dropped connection stays dropped, so a retry that is to reach the server needs dial to open another; wait sleeps for the backoff. @socket.connect_retrying wires both.
pub(all) struct RetryOptions {
attempts : Int32
base_delay : Int64
max_delay : Int64
level : Int32
jitter : Bool
}How a call retries after a transport failure: how many attempts in total, the backoff between them and how hard it backs off.
pub(all) struct Sample {
timestamp : Int64
value : Double
}One sample: when it was recorded, and what it measured.
pub(all) struct Schema {
on : IndexKind
prefixes : Array[String]
filter : String?
language : String?
language_field : String?
score : Double?
score_field : String?
temporary : Int64?
stopwords : Array[String]?
fields : Array[SchemaField]
}What FT.CREATE builds: the documents it reads and the fields it indexes.
pub(all) struct SchemaField {
name : String
kind : SchemaKind
as_ : String?
sortable : Bool
unf : Bool
noindex : Bool
weight : Double?
separator : String?
case_sensitive : Bool
phonetic : String?
no_stem : Bool
with_suffix_trie : Bool
index_empty : Bool
index_missing : Bool
vector : VectorSpec?
}One field of a schema: the document field it reads, the name queries use, and the options its type takes.
pub(all) enum SchemaKind {
Text
Tag
Numeric
Geo
Vector
}The type of one schema field.
pub struct Script {
source : String
// private fields
}A Lua script run by its digest: loaded on first use, and loaded again if the server has forgotten it.
pub(all) struct SearchHit {
id : String
fields : Array[(String, @resp.RespValue)]
score : Double?
payload : Bytes?
sort_key : String?
}One document a query returned: its key, the fields asked for, and the score, payload or sort key when the query asked for them.
pub(all) struct SearchOptions {
nocontent : Bool
verbatim : Bool
with_scores : Bool
with_payloads : Bool
with_sort_keys : Bool
return_fields : Array[String]
highlight : Array[String]
summarize : Summarize?
sort_by : SortKey?
offset : Int64
limit : Int64
dialect : Int32?
params : Array[(String, Bytes)]
timeout : Int64?
in_keys : Array[String]
in_fields : Array[String]
filter : NumericFilter?
geo_filter : GeoFilter?
scorer : String?
slop : Int64?
language : String?
explain_score : Bool
}The options FT.SEARCH takes besides the index and the query.
pub(all) struct SearchResult {
total : Int64
hits : Array[SearchHit]
warnings : Array[String]
}What FT.SEARCH and FT.HYBRID answer: how many documents matched, the ones this page returned, and any warning the query raised.
pub struct SentinelClient {
sentinels : Array[&RedisConn]
}A client that resolves a master address through a list of sentinel connections, trying each in turn until one answers.
pub(all) struct Series {
key : String
labels : Array[(String, String)]
samples : Array[Sample]
}One series of a multi-series reply: its key, its labels, and the samples the query selected.
pub(all) struct SortKey {
field : String
ascending : Bool
}A field to sort by and the direction.
pub(all) struct SpellCheckTerm {
term : String
suggestions : Array[(Double, String)]
}One term the index does not know, and what it suggests instead.
pub struct StreamEntry {
id : String
fields : Array[(String, String)]
}One stream entry: its id and its field/value pairs.
pub(all) struct Summarize {
fields : Array[String]
fragments : Int64?
length : Int64?
separator : String?
}Which fragments of each field SUMMARIZE returns, and with what separator.
pub(all) enum TimeBound {
Min
Max
At(Int64)
}A point in a range query: the earliest sample the series has, the latest, or a timestamp.
pub(all) struct TrackingOptions {
enabled : Bool
bcast : Bool
optin : Bool
optout : Bool
noloop : Bool
redirect : Int64?
}Client-side caching (CLIENT TRACKING): whether keys this client reads are tracked so redis pushes invalidations, and in which mode.
pub(all) struct TsInfo {
total_samples : Int64
memory_usage : Int64
first_timestamp : Int64
last_timestamp : Int64
retention_millis : Int64
chunk_count : Int64
chunk_size : Int64
chunk_type : String
duplicate_policy : String
labels : Array[(String, String)]
source_key : String?
rules : Array[CompactionRule]
ignore_max_time_diff : Int64
ignore_max_val_diff : Double
}What TS.INFO reports about a series.
pub(all) enum VectorAlgorithm {
Flat
Hnsw
}How a vector field is indexed: Flat scans every vector, Hnsw builds a navigable small-world graph over them.
pub(all) struct VectorSpec {
algorithm : VectorAlgorithm
dim : Int32
element : String
distance : String
initial_cap : Int64?
block_size : Int64?
m : Int64?
ef_construction : Int64?
ef_runtime : Int64?
epsilon : Double?
}The parameters a VECTOR field takes.
Values 11
pub let aggregate_default : AggregateOptions
FT.AGGREGATE's options at their documented defaults.
pub let client_default : ClientOptions
pub let hybrid_default : HybridOptions
FT.HYBRID's options at their documented defaults.
pub let multi_get_default : MultiGetOptions
Multi-series get options at their documented defaults.
pub let multi_range_default : MultiRangeOptions
Multi-series range options at their documented defaults.
pub let pool_default : PoolOptions
pub let range_default : RangeOptions
Range options at their documented defaults.
pub let redirect_limit : Int32
How many redirects one command may follow before giving up.
pub let retry_default : RetryOptions
pub let search_default : SearchOptions
FT.SEARCH's options at their documented defaults.
pub let tracking_default : TrackingOptions
Functions & methods 418
pub fn aggregate_field(Array[(String, FieldValue)], String) -> FieldValue?
The value of name in an aggregate row.
pub fn arg_bytes(Bytes) -> Bytes
A binary-safe argument, passed through unchanged.
pub fn arg_double(Double) -> Bytes
A Double argument as its decimal text.
pub fn arg_int(Int32) -> Bytes
An Int argument as its decimal text.
pub fn arg_int64(Int64) -> Bytes
An Int64 argument as its decimal text.
pub fn arg_string(String) -> Bytes
A string argument, UTF-8 encoded.
pub fn backoff_delay(Int32, RetryOptions) -> Int64
The delay before retry number attempt (0-based), growing as base * level^attempt and capped at max_delay. The transport adds jitter when the policy asks for it.
pub async fn Client::append(Self, String, String) -> Int64 raise RedisError
APPEND key value: append value to key, returning the new length in bytes.
pub async fn Client::auth(Self, String) -> Unit raise RedisError
AUTH password: authenticate with the default user.
pub async fn Client::auth_user(Self, String, String) -> Unit raise RedisError
AUTH user password: authenticate with a named ACL account.
pub async fn Client::bf_add(Self, String, String) -> Bool raise RedisError
BF.ADD key item: add an item, returning whether the filter changed — false when it probably held the item already.
pub async fn Client::bf_card(Self, String) -> Int64 raise RedisError
BF.CARD key: how many items were added, duplicates included.
pub async fn Client::bf_exists(Self, String, String) -> Bool raise RedisError
BF.EXISTS key item: whether the filter probably holds the item.
pub async fn Client::bf_info(Self, String) -> Info raise RedisError
BF.INFO key: capacity, memory and item counts.
pub async fn Client::bf_insert(Self, String, Array[String], capacity? : Int64, error_rate? : Double, expansion? : Int64, nocreate? : Bool, nonscaling? : Bool) -> Array[Bool] raise RedisError
BF.INSERT key [CAPACITY n] [ERROR rate] [EXPANSION n] [NOCREATE] [NONSCALING] ITEMS item...: add items, creating the filter from these parameters when it does not exist.
pub async fn Client::bf_loadchunk(Self, String, Int64, Bytes) -> Unit raise RedisError
BF.LOADCHUNK key iterator data: restore one chunk of a serialized filter.
pub async fn Client::bf_madd(Self, String, Array[String]) -> Array[Bool] raise RedisError
BF.MADD key item [item ...]: add items, one flag each.
pub async fn Client::bf_mexists(Self, String, Array[String]) -> Array[Bool] raise RedisError
BF.MEXISTS key item [item ...]: one answer per item.
pub async fn Client::bf_reserve(Self, String, Double, Int64, expansion? : Int64, nonscaling? : Bool) -> Unit raise RedisError
BF.RESERVE key error_rate capacity [EXPANSION expansion] [NONSCALING]: create a Bloom filter sized for capacity items at error_rate false positives. A filter that grows keeps its rate by adding sub-filters of expansion times the capacity; nonscaling fixes it at the initial size and starts refusing items when full.
pub async fn Client::bf_scandump(Self, String, Int64) -> (Int64, Bytes?) raise RedisError
BF.SCANDUMP key iterator: the next chunk of a serialized filter, and the iterator to ask for the one after it. Iteration ends when the iterator comes back as 0.
pub async fn Client::bgrewriteaof(Self) -> String raise RedisError
BGREWRITEAOF: start a background rewrite of the append-only file.
pub async fn Client::bgsave(Self) -> String raise RedisError
BGSAVE: start a background save, returning the status line.
pub async fn Client::bitcount(Self, String, start? : Int32, end? : Int32) -> Int64 raise RedisError
BITCOUNT key [start end]: the number of set bits, optionally within a byte range.
pub async fn Client::bitop(Self, String, String, Array[String]) -> Int64 raise RedisError
BITOP op dest key...: store the bitwise AND/OR/XOR of the keys, or the NOT of a single key, in dest, returning the result length in bytes.
pub async fn Client::bitpos(Self, String, Int32, start? : Int32, end? : Int32) -> Int64 raise RedisError
BITPOS key bit [start end]: the first bit equal to bit (0 or 1), optionally within a byte range. -1 if none is found.
pub async fn Client::blmove(Self, String, String, String, String, Int32) -> Bytes? raise RedisError
BLMOVE source destination wherefrom whereto timeout: blocking LMOVE.
pub async fn Client::blpop(Self, Array[String], Int32) -> (String, Bytes)? raise RedisError
BLPOP key... timeout: blocking pop of the first available head element across the given keys, waiting up to timeout seconds (0 = forever). Returns the key and value, or None on timeout.
pub async fn Client::brpop(Self, Array[String], Int32) -> (String, Bytes)? raise RedisError
BRPOP key... timeout: blocking pop of the first available tail element across the given keys. Returns the key and value, or None on timeout.
pub async fn Client::brpoplpush(Self, String, String, Int32) -> Bytes? raise RedisError
BRPOPLPUSH source destination timeout: blocking RPOPLPUSH.
pub async fn Client::bzpopmax(Self, Array[String], Int32) -> (String, String, Double)? raise RedisError
BZPOPMAX key... timeout: blocking pop of the highest-scoring member across keys.
pub async fn Client::bzpopmin(Self, Array[String], Int32) -> (String, String, Double)? raise RedisError
BZPOPMIN key... timeout: blocking pop of the lowest-scoring member across keys. Returns (key, member, score), or None on timeout.
pub async fn Client::cf_add(Self, String, String) -> Bool raise RedisError
CF.ADD key item: add an item, returning whether it was added.
pub async fn Client::cf_addnx(Self, String, String) -> Bool raise RedisError
CF.ADDNX key item: add an item only if the filter does not hold it yet.
pub async fn Client::cf_count(Self, String, String) -> Int64 raise RedisError
CF.COUNT key item: how many times the item was added.
pub async fn Client::cf_del(Self, String, String) -> Bool raise RedisError
CF.DEL key item: remove one occurrence of an item. True if it was there.
pub async fn Client::cf_exists(Self, String, String) -> Bool raise RedisError
CF.EXISTS key item: whether the filter probably holds the item.
pub async fn Client::cf_info(Self, String) -> Info raise RedisError
CF.INFO key: size, buckets and item counts.
pub async fn Client::cf_insert(Self, String, Array[String], capacity? : Int64, nocreate? : Bool) -> Array[Bool] raise RedisError
CF.INSERT key [CAPACITY n] [NOCREATE] ITEMS item...: add items, creating the filter when it does not exist.
pub async fn Client::cf_insertnx(Self, String, Array[String], capacity? : Int64, nocreate? : Bool) -> Array[Bool] raise RedisError
CF.INSERTNX key [CAPACITY n] [NOCREATE] ITEMS item...: add the items the filter does not hold yet.
pub async fn Client::cf_loadchunk(Self, String, Int64, Bytes) -> Unit raise RedisError
CF.LOADCHUNK key iterator data: restore one chunk of a serialized filter.
pub async fn Client::cf_mexists(Self, String, Array[String]) -> Array[Bool] raise RedisError
CF.MEXISTS key item [item ...]: one answer per item.
pub async fn Client::cf_reserve(Self, String, Int64, bucket_size? : Int64, max_iterations? : Int64, expansion? : Int64) -> Unit raise RedisError
CF.RESERVE key capacity [BUCKETSIZE n] [MAXITERATIONS n] [EXPANSION n]: create a cuckoo filter for capacity items.
pub async fn Client::cf_scandump(Self, String, Int64) -> (Int64, Bytes?) raise RedisError
CF.SCANDUMP key iterator: the next chunk of a serialized filter, and the iterator for the one after it.
pub async fn Client::client_getname(Self) -> String? raise RedisError
CLIENT GETNAME: this connection's name, or None if unset.
pub async fn Client::client_id(Self) -> Int64 raise RedisError
CLIENT ID: this connection's numeric id.
pub async fn Client::client_kill(Self, Array[String]) -> Int64 raise RedisError
CLIENT KILL [ID id] [ADDR host:port] [TYPE ...] [SKIPME yes/no]: close matching client connections.
pub async fn Client::client_setname(Self, String) -> Unit raise RedisError
CLIENT SETNAME name: label this connection in CLIENT LIST.
pub async fn Client::cluster_slots(Self) -> @resp.RespValue raise RedisError
CLUSTER SLOTS: the cluster's slot map, as the raw reply (each caller decodes it).
pub async fn Client::cms_incrby(Self, String, Array[(String, Int64)]) -> Array[Int64] raise RedisError
CMS.INCRBY key item increment [item increment ...]: add to the counts, returning the new count of each item.
pub async fn Client::cms_info(Self, String) -> Info raise RedisError
CMS.INFO key: width, depth and total count.
pub async fn Client::cms_initbydim(Self, String, Int64, Int64) -> Unit raise RedisError
CMS.INITBYDIM key width depth: create a count-min sketch of width counters per row and depth rows. The error is about 1/width of the total count, the failure probability about 1/2^depth.
pub async fn Client::cms_initbyprob(Self, String, Double, Double) -> Unit raise RedisError
CMS.INITBYPROB key error probability: create a count-min sketch from the error it may make relative to the total count, and the probability of exceeding it.
pub async fn Client::cms_merge(Self, String, Array[String], weights? : Array[Int64]) -> Unit raise RedisError
CMS.MERGE destination numKeys source... [WEIGHTS w...]: add several sketches into destination, each scaled by its weight.
pub async fn Client::cms_query(Self, String, Array[String]) -> Array[Int64] raise RedisError
CMS.QUERY key item [item ...]: the estimated count of each item.
pub async fn Client::command(Self, Array[Bytes]) -> @resp.RespValue raise RedisError
Send args as a command and return the reply, turning a redis error reply (-ERR or a bulk error) into RedisError::Reply. A transport failure raises from execute as a Connection or Closed error, unchanged.
pub async fn Client::command_count(Self) -> Int64 raise RedisError
COMMAND COUNT: the number of commands the server implements.
pub async fn Client::config_get(Self, String) -> Array[(String, String)] raise RedisError
CONFIG GET parameter: the current value(s) of a config parameter (which may match several via a glob), as alternating name/value pairs.
pub async fn Client::config_resetstat(Self) -> Unit raise RedisError
CONFIG RESETSTAT: reset the server's statistics counters.
pub async fn Client::config_rewrite(Self) -> Unit raise RedisError
CONFIG REWRITE: persist the running config to the config file.
pub async fn Client::config_set(Self, String, String) -> Unit raise RedisError
CONFIG SET parameter value: change a config parameter at runtime.
pub async fn Client::copy(Self, String, String, db? : Int32, replace? : Bool) -> Bool raise RedisError
COPY source destination [DB n] [REPLACE]: copy source to destination. true if copied.
pub async fn Client::dbsize(Self) -> Int64 raise RedisError
DBSIZE: the number of keys in the selected database.
pub async fn Client::decr(Self, String) -> Int64 raise RedisError
DECR key: decrement key's integer value by 1, returning the result.
pub async fn Client::decrby(Self, String, Int64) -> Int64 raise RedisError
DECRBY key n: subtract n from key's integer value, returning the result.
pub async fn Client::del(Self, Array[String]) -> Int64 raise RedisError
DEL key...: delete the given keys, returning how many existed.
pub async fn Client::discard(Self) -> Unit raise RedisError
DISCARD: abort a transaction started with MULTI.
pub async fn Client::dump(Self, String) -> Bytes? raise RedisError
DUMP key: serialise key's value to a binary dump, or None if the key is absent.
pub async fn Client::echo(Self, String) -> Bytes raise RedisError
ECHO message: return message unchanged (a larger round-trip probe than PING).
pub async fn Client::eval(Self, String, Array[String], Array[String]) -> @resp.RespValue raise RedisError
EVAL script numkeys key... arg...: run script, declaring how many of the leading arguments are keys. Returns the script's (arbitrary) reply.
pub async fn Client::evalsha(Self, String, Array[String], Array[String]) -> @resp.RespValue raise RedisError
EVALSHA sha numkeys key... arg...: run a script by its SCRIPT LOAD digest.
pub async fn Client::exists(Self, Array[String]) -> Int64 raise RedisError
EXISTS key...: the number of the given keys that exist.
pub async fn Client::expire(Self, String, Int64) -> Bool raise RedisError
EXPIRE key secs: set a secs-second expiry on key. false if the key is absent.
pub async fn Client::expireat(Self, String, Int64) -> Bool raise RedisError
EXPIREAT key ts: expire key at the given Unix second. false if the key is absent.
pub async fn Client::flushall(Self, sync? : Bool) -> Unit raise RedisError
FLUSHALL [ASYNC|SYNC]: delete every key in every database.
pub async fn Client::flushdb(Self, sync? : Bool) -> Unit raise RedisError
FLUSHDB [ASYNC|SYNC]: delete every key in the selected database.
pub async fn Client::ft_aggregate(Self, String, String, options? : AggregateOptions) -> AggregateResult raise RedisError
FT.AGGREGATE index query [options]: run the pipeline of loads, groupings, applies, sorts and filters options describes over the matching documents.
pub async fn Client::ft_aliasadd(Self, String, String) -> Unit raise RedisError
FT.ALIASADD alias index: make alias another name for index.
pub async fn Client::ft_aliasdel(Self, String) -> Unit raise RedisError
FT.ALIASDEL alias: drop an alias.
pub async fn Client::ft_aliasupdate(Self, String, String) -> Unit raise RedisError
FT.ALIASUPDATE alias index: point an existing alias at another index.
pub async fn Client::ft_alter(Self, String, Array[SchemaField], skip_initial_scan? : Bool) -> Unit raise RedisError
FT.ALTER index [SKIPINITIALSCAN] SCHEMA ADD field...: add fields to a live index. skip_initial_scan leaves the documents already indexed unbackfilled.
pub async fn Client::ft_config_get(Self, String) -> Array[(String, String)] raise RedisError
FT.CONFIG GET pattern: the settings whose names match.
pub async fn Client::ft_config_set(Self, String, String) -> Unit raise RedisError
FT.CONFIG SET name value: change a search setting.
pub async fn Client::ft_create(Self, String, Schema) -> Unit raise RedisError
FT.CREATE index [ON HASH|JSON] [PREFIX n ...] [FILTER expr] [LANGUAGE l] [LANGUAGE_FIELD f] [SCORE s] [SCORE_FIELD f] [TEMPORARY secs] [STOPWORDS n ...] SCHEMA field...: build an index over the documents schema describes.
pub async fn Client::ft_cursor_del(Self, String, Int64) -> Unit raise RedisError
FT.CURSOR DEL index cursor: drop a cursor and the rows it still holds.
pub async fn Client::ft_cursor_read(Self, String, Int64, count? : Int64) -> AggregateResult raise RedisError
FT.CURSOR READ index cursor [COUNT n]: the next page of an aggregation.
pub async fn Client::ft_dictadd(Self, String, Array[String]) -> Int64 raise RedisError
FT.DICTADD dictionary term [term ...]: add terms to a spelling dictionary, returning how many were new.
pub async fn Client::ft_dictdel(Self, String, Array[String]) -> Int64 raise RedisError
FT.DICTDEL dictionary term [term ...]: remove terms, returning how many existed.
pub async fn Client::ft_dictdump(Self, String) -> Array[String] raise RedisError
FT.DICTDUMP dictionary: every term in a dictionary.
pub async fn Client::ft_dropindex(Self, String, delete_documents? : Bool) -> Unit raise RedisError
FT.DROPINDEX index [DD]: drop an index, and with delete_documents the documents it indexed.
pub async fn Client::ft_explain(Self, String, String, dialect? : Int32) -> String raise RedisError
FT.EXPLAIN index query [DIALECT d]: the query as the engine interprets it.
pub async fn Client::ft_explaincli(Self, String, String, dialect? : Int32) -> Array[String] raise RedisError
FT.EXPLAINCLI index query [DIALECT d]: the same, one line per node.
pub async fn Client::ft_hybrid(Self, String, String, String, Bytes, options? : HybridOptions) -> SearchResult raise RedisError
FT.HYBRID index SEARCH query VSIM @field $vector [KNN ...] [COMBINE ...] [LOAD ...] [SORTBY ...] [LIMIT ...] [FILTER ...] PARAMS ...: rank documents by a text search and a vector search at once. vector is the query vector as the field's element type writes it, and vector_field the name of the schema field it is compared against.
pub async fn Client::ft_info(Self, String) -> IndexInfo raise RedisError
FT.INFO index: the index's size, schema and settings.
pub async fn Client::ft_list(Self) -> Array[String] raise RedisError
FT._LIST: the names of the indexes.
pub async fn Client::ft_profile(Self, String, Bool, String, limited? : Bool) -> @resp.RespValue raise RedisError
FT.PROFILE index SEARCH|AGGREGATE [LIMITED] QUERY query: the ordinary reply and the timing breakdown beside it, as the protocol carries them. The second element is a nested profile whose shape the search engine documents, so it stays as it arrives.
pub async fn Client::ft_search(Self, String, String, options? : SearchOptions) -> SearchResult raise RedisError
FT.SEARCH index query [options]: the documents that match query, with the scoring, paging, sorting and projection options asks for.
pub async fn Client::ft_spellcheck(Self, String, String, distance? : Int32, dialect? : Int32) -> Array[SpellCheckTerm] raise RedisError
FT.SPELLCHECK index query [DISTANCE d] [DIALECT d]: the query terms the index knows nothing about, and what it suggests instead.
pub async fn Client::ft_sugadd(Self, String, String, Double, increment? : Bool, payload? : String) -> Int64 raise RedisError
FT.SUGADD key suggestion score [INCR] [PAYLOAD payload]: add a completion, returning how many suggestions the key holds.
pub async fn Client::ft_sugdel(Self, String, String) -> Bool raise RedisError
FT.SUGDEL key suggestion: remove a completion. True if it was there.
pub async fn Client::ft_sugget(Self, String, String, fuzzy? : Bool, max? : Int64) -> Array[String] raise RedisError
FT.SUGGET key prefix [FUZZY] [MAX n]: the completions starting with prefix.
pub async fn Client::ft_sugget_scored(Self, String, String, fuzzy? : Bool, max? : Int64) -> Array[(String, Double)] raise RedisError
FT.SUGGET key prefix WITHSCORES: the completions and their scores.
pub async fn Client::ft_suglen(Self, String) -> Int64 raise RedisError
FT.SUGLEN key: how many completions a key holds.
pub async fn Client::ft_syndump(Self, String) -> Array[(String, Array[String])] raise RedisError
FT.SYNDUMP index: each term that has synonyms, and the groups it belongs to.
pub async fn Client::ft_synupdate(Self, String, String, Array[String], skip_initial_scan? : Bool) -> Unit raise RedisError
FT.SYNUPDATE index group [SKIPINITIALSCAN] term [term ...]: put the terms in one synonym group.
pub async fn Client::ft_tagvals(Self, String, String) -> Array[String] raise RedisError
FT.TAGVALS index field: the distinct values of a tag field.
pub async fn Client::function_call(Self, String, Array[String], Array[String]) -> @resp.RespValue raise RedisError
FCALL function numkeys key... arg...: call a registered function.
pub async fn Client::function_delete(Self, String) -> Unit raise RedisError
FUNCTION DELETE name: delete a function library by name.
pub async fn Client::function_flush(Self) -> Unit raise RedisError
FUNCTION FLUSH: discard every registered function library.
pub async fn Client::function_load(Self, String, replace? : Bool) -> String raise RedisError
FUNCTION LOAD [REPLACE] code: register a functions library, returning its name.
pub async fn Client::geoadd(Self, String, Array[(String, Double, Double)]) -> Int64 raise RedisError
GEOADD key longitude latitude member...: index the members, returning how many were new.
pub async fn Client::geodist(Self, String, String, String, unit? : String) -> Double? raise RedisError
GEODIST key a b [unit]: the distance between members a and b, or None if a member is absent. unit is one of m, km, mi, ft (metres by default).
pub async fn Client::geohash(Self, String, Array[String]) -> Array[String?] raise RedisError
GEOHASH key member...: the geohash string of each member, None where absent.
pub async fn Client::geopos(Self, String, Array[String]) -> Array[(Double, Double)?] raise RedisError
GEOPOS key member...: the [longitude, latitude] of each member, None where absent.
pub async fn Client::geosearch(Self, String, from_member? : String, longitude? : Double, latitude? : Double, radius? : Double, width? : Double, height? : Double, String, count? : Int32, asc? : Bool, desc? : Bool) -> Array[String] raise RedisError
GEOSEARCH key [FROMMEMBER m] [FROMLONLAT lon lat] [BYRADIUS r unit] [BYBOX w h unit] [COUNT n] [ASC|DESC]: the members matching a circular or rectangular area, optionally ordered and capped. Returns the member names.
pub async fn Client::get(Self, String) -> Bytes? raise RedisError
GET key: the value at key, or None if absent or expired.
pub async fn Client::getbit(Self, String, Int64) -> Int64 raise RedisError
GETBIT key offset: the bit at offset (0 or 1).
pub async fn Client::getdel(Self, String) -> Bytes? raise RedisError
GETDEL key: return key's value and delete the key, or None if absent.
pub async fn Client::getex(Self, String, ex? : Int64, px? : Int64, exat? : Int64, pxat? : Int64, persist? : Bool) -> Bytes? raise RedisError
GETEX key [EX secs] [PX ms] [EXAT secs] [PXAT ms] [PERSIST]: return key's value and apply or clear its expiry, or None if absent.
pub async fn Client::getrange(Self, String, Int32, Int32) -> Bytes raise RedisError
GETRANGE key start end: the substring of key from start to end (inclusive, negative from the end).
pub async fn Client::hdel(Self, String, Array[String]) -> Int64 raise RedisError
HDEL key field...: delete the given fields, returning how many existed.
pub async fn Client::hexists(Self, String, String) -> Bool raise RedisError
HEXISTS key field: whether field exists in the hash.
pub async fn Client::hget(Self, String, String) -> Bytes? raise RedisError
HGET key field: the value at field, or None if the key or field is absent.
pub async fn Client::hgetall(Self, String) -> Array[(String, String)] raise RedisError
HGETALL key: every field/value pair as an array of alternating field, value.
pub async fn Client::hincrby(Self, String, String, Int64) -> Int64 raise RedisError
HINCRBY key field n: add n to field's integer value, returning the result.
pub async fn Client::hincrbyfloat(Self, String, String, Double) -> Double raise RedisError
HINCRBYFLOAT key field f: add f to field's value, returning the new value.
pub async fn Client::hkeys(Self, String) -> Array[String] raise RedisError
HKEYS key: the field names of the hash.
pub async fn Client::hlen(Self, String) -> Int64 raise RedisError
HLEN key: the number of fields in the hash.
pub async fn Client::hmget(Self, String, Array[String]) -> Array[Bytes?] raise RedisError
HMGET key field...: the value at each field, None where absent, in order.
pub async fn Client::hmset(Self, String, Array[(String, String)]) -> Unit raise RedisError
HMSET key field value...: set several fields atomically. Deprecated in favour of HSET, kept because servers still answer it and callers still send it.
pub async fn Client::hrandfield(Self, String, count? : Int32) -> Array[String] raise RedisError
HRANDFIELD key [count] [WITHVALUES]: one or more random fields, optionally with their values.
pub async fn Client::hrandfield_values(Self, String, Int32) -> Array[(String, String)] raise RedisError
HRANDFIELD key count WITHVALUES: random fields with their values. A negative count may repeat a field.
pub async fn Client::hscan(Self, String, String, pattern? : String, count? : Int32) -> (String, Array[(String, String)]) raise RedisError
HSCAN key cursor [MATCH pattern] [COUNT n]: an incremental hash field scan. Returns the next cursor and the field/value pairs found this call.
pub async fn Client::hset(Self, String, Array[(String, String)]) -> Int64 raise RedisError
HSET key field value...: set one or more fields, returning the count of fields that were new.
pub async fn Client::hsetnx(Self, String, String, String) -> Bool raise RedisError
HSETNX key field value: set field only if absent. true if set.
pub async fn Client::hstrlen(Self, String, String) -> Int64 raise RedisError
HSTRLEN key field: the byte length of field's value (0 if absent).
pub async fn Client::hvals(Self, String) -> Array[String] raise RedisError
HVALS key: the values of the hash.
pub async fn Client::incr(Self, String) -> Int64 raise RedisError
INCR key: increment key's integer value by 1, returning the result.
pub async fn Client::incrby(Self, String, Int64) -> Int64 raise RedisError
INCRBY key n: add n to key's integer value, returning the result.
pub async fn Client::info(Self, section? : String) -> String raise RedisError
INFO [section]: the server's key/value metrics, as the raw text block redis returns.
pub async fn Client::json_arrappend(Self, String, String, Array[@json.Json]) -> Array[Int64?] raise RedisError
JSON.ARRAPPEND key path value [value ...]: append the values to each array at path, returning the new lengths.
pub async fn Client::json_arrindex(Self, String, String, @json.Json, start? : Int64, stop? : Int64) -> Array[Int64?] raise RedisError
JSON.ARRINDEX key path value [START start] [STOP stop]: the first position of value in each array at path, -1 when absent.
pub async fn Client::json_arrinsert(Self, String, String, Int64, Array[@json.Json]) -> Array[Int64?] raise RedisError
JSON.ARRINSERT key path index value [value ...]: insert the values at index in each array at path, returning the new lengths.
pub async fn Client::json_arrlen(Self, String, path? : String) -> Array[Int64?] raise RedisError
JSON.ARRLEN key [path]: the length of each array at path.
pub async fn Client::json_arrpop(Self, String, String, index? : Int64) -> Array[@json.Json?] raise RedisError
JSON.ARRPOP key [path] [index]: pop an element from each array at path, index -1 being the last, returning the popped values.
pub async fn Client::json_arrtrim(Self, String, String, Int64, Int64) -> Array[Int64?] raise RedisError
JSON.ARRTRIM key path start stop: trim each array at path to the inclusive range, returning the new lengths.
pub async fn Client::json_clear(Self, String, path? : String) -> Int64 raise RedisError
JSON.CLEAR key [path]: empty the arrays and objects at path, returning how many values were cleared.
pub async fn Client::json_debug_memory(Self, String, path? : String) -> Int64 raise RedisError
JSON.DEBUG MEMORY key [path]: the bytes the value at path occupies.
pub async fn Client::json_del(Self, String, path? : String) -> Int64 raise RedisError
JSON.DEL key [path]: delete the document or the part at path, returning how many values were removed.
pub async fn Client::json_forget(Self, String, path? : String) -> Int64 raise RedisError
JSON.FORGET key [path]: the older name for JSON.DEL.
pub async fn Client::json_get(Self, String, path? : String) -> @json.Json? raise RedisError
JSON.GET key [path]: the document, or the part of it at path, or None when the key is missing. A JSONPath that matches nothing yields an empty array, which is not None.
pub async fn Client::json_get_text(Self, String, path? : String, indent? : String, newline? : String, space? : String) -> String? raise RedisError
JSON.GET key [INDENT i] [NEWLINE n] [SPACE s] [path]: the reply exactly as the server wrote it, formatting included.
pub async fn Client::json_merge(Self, String, String, @json.Json) -> Unit raise RedisError
JSON.MERGE key path value: merge value into the object at path, by RFC 7396: a null member removes the member, an object merges recursively, anything else replaces.
pub async fn Client::json_mget(Self, Array[String], String) -> Array[@json.Json?] raise RedisError
JSON.MGET key [key ...] path: the value at path in each key, None where a key has nothing there.
pub async fn Client::json_mset(Self, Array[(String, String, @json.Json)]) -> Unit raise RedisError
JSON.MSET key path value [key path value ...]: set several documents at once, all or none.
pub async fn Client::json_numincrby(Self, String, String, Double) -> Array[Double?] raise RedisError
JSON.NUMINCRBY key path value: add value to each number at path, returning the new values.
pub async fn Client::json_nummultby(Self, String, String, Double) -> Array[Double?] raise RedisError
JSON.NUMMULTBY key path value: multiply each number at path by value, returning the new values.
pub async fn Client::json_objkeys(Self, String, path? : String) -> Array[Array[String]?] raise RedisError
JSON.OBJKEYS key [path]: the member names of each object at path.
pub async fn Client::json_objlen(Self, String, path? : String) -> Array[Int64?] raise RedisError
JSON.OBJLEN key [path]: the number of members of each object at path.
pub async fn Client::json_resp(Self, String, path? : String) -> @resp.RespValue raise RedisError
JSON.RESP key [path]: the value as RESP itself, with [ and { markers for arrays and objects. It is the one JSON command whose reply is not a JSON document.
pub async fn Client::json_set(Self, String, String, @json.Json, nx? : Bool, xx? : Bool, fpha? : Fpha) -> Bool raise RedisError
JSON.SET key path value [NX|XX] [FPHA type]: store value at path in key. Returns false when nx or xx leaves the key unchanged.
pub async fn Client::json_strappend(Self, String, String, String) -> Array[Int64?] raise RedisError
JSON.STRAPPEND key [path] value: append value, a JSON string, to each string at path, returning the new lengths.
pub async fn Client::json_strlen(Self, String, path? : String) -> Array[Int64?] raise RedisError
JSON.STRLEN key [path]: the length of each string at path.
pub async fn Client::json_toggle(Self, String, String) -> Array[Bool?] raise RedisError
JSON.TOGGLE key path: flip each boolean at path, returning the new values.
pub async fn Client::json_type(Self, String, path? : String) -> Array[String?] raise RedisError
JSON.TYPE key [path]: the JSON type of each value at path — object, array, string, integer, number, boolean or null — None where nothing matched.
pub async fn Client::keys(Self, String) -> Array[String] raise RedisError
KEYS pattern: every key matching pattern. Use scan in production.
pub async fn Client::lastsave(Self) -> Int64 raise RedisError
LASTSAVE: the Unix timestamp of the last successful save to disk.
pub async fn Client::lindex(Self, String, Int32) -> Bytes? raise RedisError
LINDEX key index: the element at index, or None if out of range.
pub async fn Client::linsert(Self, String, String, String, String) -> Int64 raise RedisError
LINSERT key where pivot value: insert value before (BEFORE) or after (AFTER) pivot. Returns the new length, or -1 when pivot is absent.
pub async fn Client::llen(Self, String) -> Int64 raise RedisError
LLEN key: the length of the list.
pub async fn Client::lmove(Self, String, String, String, String) -> Bytes? raise RedisError
LMOVE source destination LEFT|RIGHT LEFT|RIGHT: pop from one end of source and push to one end of destination, returning the element, or None when empty.
pub async fn Client::lpop(Self, String) -> Bytes? raise RedisError
LPOP key: remove and return the head element, or None when the list is empty.
pub async fn Client::lpopn(Self, String, Int32) -> Array[Bytes] raise RedisError
LPOP key count: remove and return up to count head elements.
pub async fn Client::lpush(Self, String, Array[String]) -> Int64 raise RedisError
LPUSH key value...: prepend each value, returning the new length.
pub async fn Client::lpushx(Self, String, Array[String]) -> Int64 raise RedisError
LPUSHX key value...: prepend only if key already exists, returning the length.
pub async fn Client::lrange(Self, String, Int32, Int32) -> Array[Bytes] raise RedisError
LRANGE key start stop: the elements from start to stop (inclusive, negative from the tail).
pub async fn Client::lrem(Self, String, Int32, String) -> Int64 raise RedisError
LREM key count value: remove the first count elements equal to value. When count is negative, remove from the tail; when 0, remove all. Returns the removed.
pub async fn Client::lset(Self, String, Int32, String) -> Unit raise RedisError
LSET key index value: set the element at index. Raises Reply on a bad index.
pub async fn Client::ltrim(Self, String, Int32, Int32) -> Unit raise RedisError
LTRIM key start stop: keep only the elements from start to stop.
pub async fn Client::mget(Self, Array[String]) -> Array[Bytes?] raise RedisError
MGET key...: the value at each key, None where a key is absent, in the same order.
pub async fn Client::move_(Self, String, Int32) -> Bool raise RedisError
MOVE key db: move key to another logical database. true if moved.
pub async fn Client::mset(Self, Array[(String, String)]) -> Unit raise RedisError
MSET key value...: store every pair atomically.
pub fn Client::new(&RedisConn) -> Self
pub async fn Client::object_encoding(Self, String) -> String raise RedisError
OBJECT ENCODING key / OBJECT REFCOUNT key / OBJECT IDLETIME key: inspect a key's internal encoding, reference count, or idle time.
pub async fn Client::object_idletime(Self, String) -> Int64 raise RedisError
pub async fn Client::object_refcount(Self, String) -> Int64 raise RedisError
pub async fn Client::persist(Self, String) -> Bool raise RedisError
PERSIST key: remove key's expiry. true if a TTL was removed.
pub async fn Client::pexpire(Self, String, Int64) -> Bool raise RedisError
PEXPIRE key ms: set a ms-millisecond expiry on key. false if the key is absent.
pub async fn Client::pexpireat(Self, String, Int64) -> Bool raise RedisError
PEXPIREAT key ts: expire key at the given Unix millisecond. false if absent.
pub async fn Client::pfadd(Self, String, Array[String]) -> Int64 raise RedisError
PFADD key value...: register the values, returning 1 if the sketch changed.
pub async fn Client::pfcount(Self, Array[String]) -> Int64 raise RedisError
PFCOUNT key...: the approximate cardinality of one key, or the union of several.
pub async fn Client::pfmerge(Self, String, Array[String]) -> Unit raise RedisError
PFMERGE dest src...: merge the source sketches into dest.
pub async fn Client::ping(Self) -> String raise RedisError
PING: a round-trip health check, returning the server's PONG text.
pub async fn Client::ping_message(Self, String) -> String raise RedisError
PING message: echo message back, confirming the connection.
pub async fn Client::psetex(Self, String, Int64, String) -> Unit raise RedisError
PSETEX key ms value: store value at key with a ms-millisecond expiry.
pub async fn Client::psubscribe(Self, Array[String]) -> Unit raise RedisError
PSUBSCRIBE pattern...: subscribe to channels by glob pattern.
pub async fn Client::pttl(Self, String) -> Int64 raise RedisError
PTTL key: key's remaining time to live in milliseconds.
pub async fn Client::publish(Self, String, String) -> Int64 raise RedisError
PUBLISH channel message: post message to channel, returning how many subscribers received it. (Publishing is an ordinary command, not a subscription.)
pub async fn Client::punsubscribe(Self, patterns? : Array[String]) -> Unit raise RedisError
PUNSUBSCRIBE [pattern...]: unsubscribe from the given patterns, or all when omitted.
pub async fn Client::randomkey(Self) -> String? raise RedisError
RANDOMKEY: a random key from the database, or None when the database is empty.
pub async fn Client::rename(Self, String, String) -> Unit raise RedisError
RENAME key newkey: rename key to newkey, replacing newkey if present.
pub async fn Client::renamenx(Self, String, String) -> Bool raise RedisError
RENAMENX key newkey: rename key to newkey only if newkey is absent. true if renamed.
pub async fn Client::replicaof(Self, String, Int32) -> Unit raise RedisError
REPLICAOF host port: make this server a replica of host:port. Use REPLICAOF NO ONE (via replicaof_noone) to promote it back to a master.
pub async fn Client::replicaof_noone(Self) -> Unit raise RedisError
REPLICAOF NO ONE: stop replicating and become a master.
pub async fn Client::restore(Self, String, Int64, Bytes, replace? : Bool, absttl? : Bool) -> Unit raise RedisError
RESTORE key ttl serialized [REPLACE] [ABSTTL]: restore a DUMP value at key with a ttl-millisecond expiry (0 = no expiry).
pub async fn Client::rpop(Self, String) -> Bytes? raise RedisError
RPOP key: remove and return the tail element, or None when the list is empty.
pub async fn Client::rpoplpush(Self, String, String) -> Bytes? raise RedisError
RPOPLPUSH source destination: pop the tail of source and push it to the head of destination, returning the element, or None when source is empty.
pub async fn Client::rpopn(Self, String, Int32) -> Array[Bytes] raise RedisError
RPOP key count: remove and return up to count tail elements.
pub async fn Client::rpush(Self, String, Array[String]) -> Int64 raise RedisError
RPUSH key value...: append each value, returning the new length.
pub async fn Client::rpushx(Self, String, Array[String]) -> Int64 raise RedisError
RPUSHX key value...: append only if key already exists, returning the length.
pub async fn Client::sadd(Self, String, Array[String]) -> Int64 raise RedisError
SADD key member...: add the members, returning how many were new.
pub async fn Client::save(Self) -> Unit raise RedisError
SAVE: synchronously save the dataset to disk (blocks the server).
pub async fn Client::scan(Self, String, pattern? : String, count? : Int32, kind? : String) -> (String, Array[String]) raise RedisError
SCAN cursor [MATCH pattern] [COUNT n] [TYPE kind]: an incremental key scan. Returns the next cursor (the empty string when the scan is done) and the keys found this call.
pub async fn Client::scard(Self, String) -> Int64 raise RedisError
SCARD key: the number of members in the set.
pub async fn Client::script_exists(Self, Array[String]) -> Array[Bool] raise RedisError
SCRIPT EXISTS sha...: whether each digest is loaded, in order.
pub async fn Client::script_flush(Self) -> Unit raise RedisError
SCRIPT FLUSH: discard every loaded script.
pub async fn Client::script_load(Self, String) -> String raise RedisError
SCRIPT LOAD script: register script and return its SHA-1 digest for later EVALSHA.
pub async fn Client::sdiff(Self, Array[String]) -> Array[String] raise RedisError
SDIFF key...: the members in the first set absent from the rest.
pub async fn Client::sdiffstore(Self, String, Array[String]) -> Int64 raise RedisError
SDIFFSTORE destination key...: store the difference of the sets in destination.
pub async fn Client::select(Self, Int32) -> Unit raise RedisError
SELECT index: switch the connection to logical database index.
pub async fn Client::sentinel(Self, Array[String]) -> @resp.RespValue raise RedisError
SENTINEL ...: send a raw sentinel sub-command (the sub-command name is the first args element), returning the reply.
pub async fn Client::sentinel_get_master_addr_by_name(Self, String) -> (String, Int32)? raise RedisError
SENTINEL GET-MASTER-ADDR-BY-NAME name: the current master's (host, port) for the monitored master name, or None if the sentinel does not know it.
pub async fn Client::set(Self, String, String, ex? : Int64, px? : Int64, nx? : Bool, xx? : Bool, keepttl? : Bool) -> Bool raise RedisError
SET key value [EX secs] [PX ms] [NX|XX] [KEEPTTL]: store value at key. Returns false when nx/xx leaves the key unchanged, true otherwise.
pub async fn Client::set_get(Self, String, String) -> Bytes? raise RedisError
SET key value GET: store value and return the value key held before, or None if it had none.
pub async fn Client::setbit(Self, String, Int64, Int32) -> Int64 raise RedisError
SETBIT key offset value: set the bit at offset (0 or 1), returning its previous value (0 or 1).
pub async fn Client::setex(Self, String, Int64, String) -> Unit raise RedisError
SETEX key secs value: store value at key with a secs-second expiry.
pub async fn Client::setnx(Self, String, String) -> Bool raise RedisError
SETNX key value: store value only if key is absent. true if stored.
pub async fn Client::setrange(Self, String, Int32, String) -> Int64 raise RedisError
SETRANGE key offset value: overwrite key at offset, returning the new length.
pub async fn Client::shutdown(Self, save? : Bool) -> Unit raise RedisError
SHUTDOWN [NOSAVE|SAVE]: stop the server. The call normally raises Closed when the connection drops, rather than returning.
pub async fn Client::sinter(Self, Array[String]) -> Array[String] raise RedisError
SINTER key...: the members present in every given set.
pub async fn Client::sinterstore(Self, String, Array[String]) -> Int64 raise RedisError
SINTERSTORE destination key...: store the intersection of the sets in destination.
pub async fn Client::sismember(Self, String, String) -> Bool raise RedisError
SISMEMBER key member: whether member is in the set.
pub async fn Client::slowlog_get(Self, count? : Int32) -> Array[@resp.RespValue] raise RedisError
SLOWLOG GET [count]: the most recent slow commands the server logged.
pub async fn Client::slowlog_len(Self) -> Int64 raise RedisError
SLOWLOG LEN: the number of entries in the slow log.
pub async fn Client::slowlog_reset(Self) -> Unit raise RedisError
SLOWLOG RESET: clear the slow log.
pub async fn Client::smembers(Self, String) -> Array[String] raise RedisError
SMEMBERS key: every member of the set.
pub async fn Client::smove(Self, String, String, String) -> Bool raise RedisError
SMOVE source destination member: move member from source to destination. true if moved.
pub async fn Client::spop(Self, String) -> String? raise RedisError
SPOP key: remove and return a random member, or None when the set is empty.
pub async fn Client::spopn(Self, String, Int32) -> Array[String] raise RedisError
SPOP key count: remove and return up to count random members.
pub async fn Client::spublish(Self, String, String) -> Int64 raise RedisError
SPUBLISH shardchannel message: post message to a shard channel, returning how many subscribers received it.
pub async fn Client::srandmember(Self, String) -> String? raise RedisError
SRANDMEMBER key: a random member, or None when the set is empty.
pub async fn Client::srandmembern(Self, String, Int32) -> Array[String] raise RedisError
SRANDMEMBER key count: count random members, with repeats when count exceeds the set size.
pub async fn Client::srem(Self, String, Array[String]) -> Int64 raise RedisError
SREM key member...: remove the members, returning how many existed.
pub async fn Client::sscan(Self, String, String, pattern? : String, count? : Int32) -> (String, Array[String]) raise RedisError
SSCAN key cursor [MATCH pattern] [COUNT n]: an incremental set member scan. Returns the next cursor and the members found this call.
pub async fn Client::ssubscribe(Self, Array[String]) -> Unit raise RedisError
SSUBSCRIBE shardchannel...: subscribe to shard channels (cluster pub/sub), which route to a single shard rather than every node.
pub async fn Client::strlen(Self, String) -> Int64 raise RedisError
STRLEN key: the length of key's value in bytes.
pub async fn Client::subscribe(Self, Array[String]) -> Unit raise RedisError
SUBSCRIBE channel...: subscribe the connection to the given channels. After this the connection receives message frames until unsubscribed.
pub async fn Client::sunion(Self, Array[String]) -> Array[String] raise RedisError
SUNION key...: the members present in any given set.
pub async fn Client::sunionstore(Self, String, Array[String]) -> Int64 raise RedisError
SUNIONSTORE destination key...: store the union of the sets in destination.
pub async fn Client::sunsubscribe(Self, channels? : Array[String]) -> Unit raise RedisError
SUNSUBSCRIBE [shardchannel...]: unsubscribe from the given shard channels, or all when omitted.
pub async fn Client::swapdb(Self, Int32, Int32) -> Unit raise RedisError
SWAPDB a b: atomically swap the data of databases a and b.
pub async fn Client::tdigest_add(Self, String, Array[Double]) -> Unit raise RedisError
TDIGEST.ADD key value [value ...]: add observations.
pub async fn Client::tdigest_byrank(Self, String, Array[Int64]) -> Array[Double] raise RedisError
TDIGEST.BYRANK key rank [rank ...]: the value at each rank.
pub async fn Client::tdigest_byrevrank(Self, String, Array[Int64]) -> Array[Double] raise RedisError
TDIGEST.BYREVRANK key rank [rank ...]: the value at each reverse rank.
pub async fn Client::tdigest_cdf(Self, String, Array[Double]) -> Array[Double] raise RedisError
TDIGEST.CDF key value [value ...]: the fraction of observations at or below each value.
pub async fn Client::tdigest_create(Self, String, compression? : Int64) -> Unit raise RedisError
TDIGEST.CREATE key [COMPRESSION compression]: create a t-digest. A higher compression keeps more centroids and estimates the tails more precisely.
pub async fn Client::tdigest_info(Self, String) -> Info raise RedisError
TDIGEST.INFO key: compression, capacity, and how many observations were merged.
pub async fn Client::tdigest_max(Self, String) -> Double raise RedisError
TDIGEST.MAX key: the largest observation, or NaN when the sketch is empty.
pub async fn Client::tdigest_merge(Self, String, Array[String], compression? : Int64, overwrite? : Bool) -> Unit raise RedisError
TDIGEST.MERGE destination numKeys source... [COMPRESSION c] [OVERRIDE]: merge sketches into one; overwrite replaces the destination's contents instead of adding.
pub async fn Client::tdigest_min(Self, String) -> Double raise RedisError
TDIGEST.MIN key: the smallest observation, or NaN when the sketch is empty.
pub async fn Client::tdigest_quantile(Self, String, Array[Double]) -> Array[Double] raise RedisError
TDIGEST.QUANTILE key quantile [quantile ...]: the value at each quantile, 0 to 1.
pub async fn Client::tdigest_rank(Self, String, Array[Double]) -> Array[Int64] raise RedisError
TDIGEST.RANK key value [value ...]: how many observations are below each value.
pub async fn Client::tdigest_reset(Self, String) -> Unit raise RedisError
TDIGEST.RESET key: empty a t-digest without dropping the key.
pub async fn Client::tdigest_revrank(Self, String, Array[Double]) -> Array[Int64] raise RedisError
TDIGEST.REVRANK key value [value ...]: how many observations are above each value.
pub async fn Client::tdigest_trimmed_mean(Self, String, Double, Double) -> Double raise RedisError
TDIGEST.TRIMMED_MEAN key low_cut high_cut: the mean after dropping the observations below low_cut and above high_cut, both quantiles from 0 to 1.
pub async fn Client::time_(Self) -> (Int64, Int64) raise RedisError
TIME: the server's current time as (seconds, microseconds).
pub async fn Client::topk_add(Self, String, Array[String]) -> Array[String?] raise RedisError
TOPK.ADD key item [item ...]: count each item, returning the item it evicted from the list at that position, or None when the list did not change.
pub async fn Client::topk_count(Self, String, Array[String]) -> Array[Int64] raise RedisError
TOPK.COUNT key item [item ...]: the estimated count of each item.
pub async fn Client::topk_incrby(Self, String, Array[(String, Int64)]) -> Array[String?] raise RedisError
TOPK.INCRBY key item increment [item increment ...]: add to the counts, returning the evicted item per entry.
pub async fn Client::topk_info(Self, String) -> Info raise RedisError
TOPK.INFO key: the sketch's size and decay.
pub async fn Client::topk_list(Self, String) -> Array[String] raise RedisError
TOPK.LIST key: the items in the top-k list, heaviest first.
pub async fn Client::topk_list_with_count(Self, String) -> Array[(String, Int64)] raise RedisError
TOPK.LIST key WITHCOUNT: the items in the top-k list with their counts.
pub async fn Client::topk_query(Self, String, Array[String]) -> Array[Bool] raise RedisError
TOPK.QUERY key item [item ...]: whether each item is in the top-k list.
pub async fn Client::topk_reserve(Self, String, Int64, width? : Int64, depth? : Int64, decay? : Double) -> Unit raise RedisError
TOPK.RESERVE key topk [width depth decay]: create a sketch that keeps the topk heaviest items.
pub async fn Client::touch(Self, Array[String]) -> Int64 raise RedisError
TOUCH key...: the number of the given keys that exist (like EXISTS but does not alter the LRU/LFU, and accepts multiple keys).
pub async fn Client::ts_add(Self, String, Int64, Double, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, on_duplicate? : String, labels? : Array[(String, String)]) -> Int64 raise RedisError
TS.ADD key timestamp value [RETENTION ms] [ENCODING ...] [CHUNK_SIZE bytes] [ON_DUPLICATE policy] [LABELS ...]: append one sample, returning its timestamp.
pub async fn Client::ts_alter(Self, String, retention? : Int64, chunk_size? : Int64, duplicate_policy? : String, ignore_max_time_diff? : Int64, ignore_max_val_diff? : Double, labels? : Array[(String, String)]) -> Unit raise RedisError
TS.ALTER key [RETENTION ms] [CHUNK_SIZE bytes] [DUPLICATE_POLICY policy] [IGNORE ...] [LABELS ...]: change a series' settings; LABELS replaces the label set.
pub async fn Client::ts_create(Self, String, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, duplicate_policy? : String, ignore_max_time_diff? : Int64, ignore_max_val_diff? : Double, labels? : Array[(String, String)]) -> Unit raise RedisError
TS.CREATE key [RETENTION ms] [ENCODING COMPRESSED|UNCOMPRESSED] [CHUNK_SIZE bytes] [DUPLICATE_POLICY policy] [IGNORE max_time_diff max_val_diff] [LABELS ...]: create a series, optionally dropping samples older than retention.
pub async fn Client::ts_createrule(Self, String, String, String, Int64, align_timestamp? : Int64) -> Unit raise RedisError
TS.CREATERULE source destination AGGREGATION aggregator bucketDuration [alignTimestamp]: compact source into destination in buckets of bucket ms.
pub async fn Client::ts_decrby(Self, String, Double, timestamp? : Int64, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, duplicate_policy? : String, labels? : Array[(String, String)]) -> Int64 raise RedisError
TS.DECRBY key value [TIMESTAMP ts] ...: subtract value from the sample at timestamp, returning the timestamp.
pub async fn Client::ts_del(Self, String, String, String) -> Int64 raise RedisError
TS.DEL key fromTimestamp toTimestamp: delete the samples in the range, returning how many were removed.
pub async fn Client::ts_deleterule(Self, String, String) -> Unit raise RedisError
TS.DELETERULE source destination: stop compacting source into destination.
pub async fn Client::ts_get(Self, String, latest? : Bool) -> Sample? raise RedisError
TS.GET key [LATEST]: the newest sample, or None when the series is empty.
pub async fn Client::ts_incrby(Self, String, Double, timestamp? : Int64, retention? : Int64, uncompressed? : Bool, chunk_size? : Int64, duplicate_policy? : String, labels? : Array[(String, String)]) -> Int64 raise RedisError
TS.INCRBY key value [TIMESTAMP ts] [RETENTION ms] [ENCODING ...] [CHUNK_SIZE bytes] [DUPLICATE_POLICY policy] [LABELS ...]: add value to the sample at timestamp, creating the sample when there is none, and return the timestamp.
pub async fn Client::ts_info(Self, String) -> TsInfo raise RedisError
TS.INFO key: the series' size, settings, labels and compaction rules.
pub async fn Client::ts_madd(Self, Array[(String, Int64, Double)]) -> Array[Int64?] raise RedisError
TS.MADD key timestamp value [key timestamp value ...]: append several samples at once, returning each timestamp, None where that sample was refused.
pub async fn Client::ts_mget(Self, Array[String], options? : MultiGetOptions) -> Array[Series] raise RedisError
TS.MGET [options] FILTER filter...: the latest sample of every series whose labels match.
pub async fn Client::ts_mrange(Self, TimeBound, TimeBound, Array[String], options? : MultiRangeOptions) -> Array[Series] raise RedisError
TS.MRANGE fromTimestamp toTimestamp [options] FILTER filter...: the samples of every series whose labels match, oldest first.
pub async fn Client::ts_mrevrange(Self, TimeBound, TimeBound, Array[String], options? : MultiRangeOptions) -> Array[Series] raise RedisError
TS.MREVRANGE fromTimestamp toTimestamp [options] FILTER filter...: the same, newest first. The bounds keep the order TS.MRANGE uses.
pub async fn Client::ts_nrange(Self, Array[String], TimeBound, TimeBound, options? : RangeOptions) -> Array[PivotRow] raise RedisError
TS.NRANGE numkeys key... fromTimestamp toTimestamp [options]: the samples of several series pivoted by timestamp, one value column per key in the order the keys are given.
pub async fn Client::ts_nrevrange(Self, Array[String], TimeBound, TimeBound, options? : RangeOptions) -> Array[PivotRow] raise RedisError
TS.NREVRANGE numkeys key... fromTimestamp toTimestamp [options]: the same, newest first. The bounds keep the order TS.NRANGE uses.
pub async fn Client::ts_queryindex(Self, Array[String]) -> Array[String] raise RedisError
TS.QUERYINDEX filter...: the keys whose labels match every filter.
pub async fn Client::ts_querylabel_values(Self, String, filters? : Array[String]) -> Array[String] raise RedisError
TS.QUERYLABELS VALUES label [FILTER filter...]: every value of one label in use.
pub async fn Client::ts_querylabels(Self, filters? : Array[String]) -> Array[String] raise RedisError
TS.QUERYLABELS [FILTER filter...]: every label name in use.
pub async fn Client::ts_range(Self, String, TimeBound, TimeBound, options? : RangeOptions) -> Array[Sample] raise RedisError
TS.RANGE key fromTimestamp toTimestamp [options]: the samples in the range, oldest first.
pub async fn Client::ts_read(Self, String, Int64, block? : (Int64, Int64), max_count? : Int64) -> Array[Sample] raise RedisError
TS.READ key timestamp [BLOCK ms count] [MAX_COUNT n]: up to max_count samples from timestamp on, waiting for at least block's count when it is given.
pub async fn Client::ts_revrange(Self, String, TimeBound, TimeBound, options? : RangeOptions) -> Array[Sample] raise RedisError
TS.REVRANGE key fromTimestamp toTimestamp [options]: the samples in the range, newest first. The bounds keep the order TS.RANGE uses; only the reply is reversed.
pub async fn Client::ttl(Self, String) -> Int64 raise RedisError
TTL key: key's remaining time to live in seconds: -2 if absent, -1 if no expiry, otherwise the seconds left.
pub async fn Client::type_(Self, String) -> String raise RedisError
TYPE key: the type stored at key (string, list, set, ...), or none.
pub async fn Client::unlink(Self, Array[String]) -> Int64 raise RedisError
UNLINK key...: delete the given keys asynchronously, returning how many existed.
pub async fn Client::unsubscribe(Self, channels? : Array[String]) -> Unit raise RedisError
UNSUBSCRIBE [channel...]: unsubscribe from the given channels, or all when omitted.
pub async fn Client::unwatch(Self) -> Unit raise RedisError
UNWATCH: clear all watched keys.
pub async fn Client::watch(Self, Array[String]) -> Unit raise RedisError
WATCH key...: mark keys so a later transaction aborts if they change before EXEC.
pub async fn Client::xack(Self, String, String, Array[String]) -> Int64 raise RedisError
XACK key group id...: acknowledge the given entries for a consumer group, returning how many were newly acknowledged.
pub async fn Client::xadd(Self, String, String, Array[(String, String)], maxlen? : Int64, approx? : Bool) -> String raise RedisError
XADD key [MAXLEN [~] n] id field value...: append an entry, returning its id. Use id of * for an auto-generated id.
pub async fn Client::xdel(Self, String, Array[String]) -> Int64 raise RedisError
XDEL key id...: delete the given entries, returning how many were removed.
pub async fn Client::xgroup_create(Self, String, String, String, mkstream? : Bool) -> Unit raise RedisError
XGROUP CREATE key group id [MKSTREAM]: create a consumer group. id is the last delivered id ($ for new entries only, 0 for all); mkstream creates the stream if absent.
pub async fn Client::xgroup_createconsumer(Self, String, String, String) -> Bool raise RedisError
XGROUP CREATECONSUMER key group consumer: create a consumer in a group. true if newly created.
pub async fn Client::xgroup_delconsumer(Self, String, String, String) -> Int64 raise RedisError
XGROUP DELCONSUMER key group consumer: delete a consumer, returning its pending entries that are now orphaned.
pub async fn Client::xgroup_destroy(Self, String, String) -> Bool raise RedisError
XGROUP DESTROY key group: delete a consumer group. true if it existed.
pub async fn Client::xlen(Self, String) -> Int64 raise RedisError
XLEN key: the number of entries in the stream.
pub async fn Client::xpending(Self, String, String) -> PendingSummary raise RedisError
XPENDING key group: the pending-entry summary for a group. For the detailed entry list use xpending_extended.
pub async fn Client::xrange(Self, String, String, String, count? : Int32) -> Array[StreamEntry] raise RedisError
XRANGE key start end [COUNT n]: the entries from start to end (use -/+ for the ends), oldest first.
pub async fn Client::xread(Self, Array[(String, String)], count? : Int32, block? : Int64) -> Array[(String, Array[StreamEntry])]? raise RedisError
XREAD [COUNT n] [BLOCK ms] STREAMS key id...: read new entries from one or more streams. block of 0 reads without blocking; a positive block waits up to that many milliseconds for the first entry. Returns, per stream, its name and the entries read, or None when a blocking read times out.
pub async fn Client::xreadgroup(Self, String, String, Array[(String, String)], count? : Int32, block? : Int64, noack? : Bool) -> Array[(String, Array[StreamEntry])]? raise RedisError
XREADGROUP GROUP group consumer [COUNT n] [BLOCK ms] [NOACK] STREAMS key id...: read entries for a consumer, marking them pending. id of > reads new entries; a specific id reads pending ones. Returns per stream its name and entries, or None on a blocking timeout.
pub async fn Client::xrevrange(Self, String, String, String, count? : Int32) -> Array[StreamEntry] raise RedisError
XREVRANGE key end start [COUNT n]: the entries from end to start, newest first.
pub async fn Client::xtrim(Self, String, Int64, approx? : Bool) -> Int64 raise RedisError
XTRIM key MAXLEN [~] n: cap the stream at n entries, returning how many were trimmed.
pub async fn Client::zadd(Self, String, Array[(String, Double)], nx? : Bool, xx? : Bool, ch? : Bool) -> Int64 raise RedisError
ZADD key [NX] [XX] [CH] score member...: add or update members with their scores, returning how many members changed (or, with ch, were added or updated).
pub async fn Client::zcard(Self, String) -> Int64 raise RedisError
ZCARD key: the number of members in the sorted set.
pub async fn Client::zcount(Self, String, String, String) -> Int64 raise RedisError
ZCOUNT key min max: the number of members with scores in [min, max].
pub async fn Client::zincrby(Self, String, Double, String) -> Double raise RedisError
ZINCRBY key increment member: add increment to member's score, returning the new score.
pub async fn Client::zinterstore(Self, String, Array[String], weights? : Array[Double], aggregate? : String) -> Int64 raise RedisError
ZINTERSTORE destination numkeys key... [WEIGHTS w...] [AGGREGATE SUM|MIN|MAX]: store the intersection of the sorted sets, returning how many members the result has.
pub async fn Client::zmscore(Self, String, Array[String]) -> Array[Double?] raise RedisError
ZMSCORE key member...: the score of each member, None where absent, in order.
pub async fn Client::zpopmax(Self, String, count? : Int32) -> Array[(String, Double)] raise RedisError
ZPOPMAX key [count]: remove and return the highest-scoring count members.
pub async fn Client::zpopmin(Self, String, count? : Int32) -> Array[(String, Double)] raise RedisError
ZPOPMIN key [count]: remove and return the lowest-scoring count members and their scores.
pub async fn Client::zrandmember(Self, String, count? : Int32) -> Array[String] raise RedisError
ZRANDMEMBER key [count] [WITHSCORES]: one or more random members, optionally with scores.
pub async fn Client::zrandmember_scores(Self, String, Int32) -> Array[(String, Double)] raise RedisError
ZRANDMEMBER key count WITHSCORES: random members with their scores. A negative count may repeat a member.
pub async fn Client::zrange(Self, String, Int32, Int32) -> Array[String] raise RedisError
ZRANGE key start stop: the members from start to stop (inclusive, negative from the tail), lowest score first.
pub async fn Client::zrange_scores(Self, String, Int32, Int32) -> Array[(String, Double)] raise RedisError
ZRANGE key start stop WITHSCORES: the members and scores in rank order.
pub async fn Client::zrangebyscore(Self, String, String, String, offset? : Int32, count? : Int32) -> Array[String] raise RedisError
ZRANGEBYSCORE key min max [LIMIT offset count]: members with scores in [min, max] (use (score to exclude a bound), lowest score first.
pub async fn Client::zrangebyscore_scores(Self, String, String, String, offset? : Int32, count? : Int32) -> Array[(String, Double)] raise RedisError
ZRANGEBYSCORE ... WITHSCORES: the members and scores in score order.
pub async fn Client::zrank(Self, String, String) -> Int64? raise RedisError
ZRANK key member: the rank (0-based, lowest score first) of member, or None if absent.
pub async fn Client::zrem(Self, String, Array[String]) -> Int64 raise RedisError
ZREM key member...: remove the members, returning how many existed.
pub async fn Client::zremrangebyrank(Self, String, Int32, Int32) -> Int64 raise RedisError
ZREMRANGEBYRANK key start stop: remove members by rank range, returning the removed.
pub async fn Client::zremrangebyscore(Self, String, String, String) -> Int64 raise RedisError
ZREMRANGEBYSCORE key min max: remove members by score range, returning the removed.
pub async fn Client::zrevrange(Self, String, Int32, Int32) -> Array[String] raise RedisError
ZREVRANGE key start stop: the members in rank order, highest score first.
pub async fn Client::zrevrange_scores(Self, String, Int32, Int32) -> Array[(String, Double)] raise RedisError
ZREVRANGE key start stop WITHSCORES: the members and scores, highest score first.
pub async fn Client::zrevrangebyscore(Self, String, String, String, offset? : Int32, count? : Int32) -> Array[String] raise RedisError
ZREVRANGEBYSCORE key max min [LIMIT offset count]: members with scores in [min, max], highest score first.
pub async fn Client::zrevrangebyscore_scores(Self, String, String, String, offset? : Int32, count? : Int32) -> Array[(String, Double)] raise RedisError
ZREVRANGEBYSCORE ... WITHSCORES: the members and scores, highest score first.
pub async fn Client::zrevrank(Self, String, String) -> Int64? raise RedisError
ZREVRANK key member: the rank (0-based, highest score first) of member.
pub async fn Client::zscan(Self, String, String, pattern? : String, count? : Int32) -> (String, Array[String]) raise RedisError
ZSCAN key cursor [MATCH pattern] [COUNT n]: an incremental sorted-set member scan. Returns the next cursor and the members found this call.
pub async fn Client::zscore(Self, String, String) -> Double? raise RedisError
ZSCORE key member: the score of member, or None if absent.
pub async fn Client::zunionstore(Self, String, Array[String], weights? : Array[Double], aggregate? : String) -> Int64 raise RedisError
ZUNIONSTORE destination numkeys key... [WEIGHTS w...] [AGGREGATE SUM|MIN|MAX]: store the union of the sorted sets, returning how many members the result has.
pub fn ClientOptions::at(String, Int32) -> Self
ClientOptions at host:port, over the standard defaults (RESP3, database 0, no TLS).
pub fn ClientOptions::with_auth(Self, String?, String?) -> Self
A copy of self that authenticates with username and password.
pub fn ClientOptions::with_db(Self, Int32) -> Self
A copy of self that SELECTs db on connect.
pub async fn ClusterClient::command(Self, Array[Bytes]) -> @resp.RespValue raise RedisError
Send args to the node owning its key, following redirects up to the limit. The key is the first argument after the command name. MOVED updates the topology, since the slot has gone for good; ASK does not, since only this key has gone ahead so far, and the node it names serves the key only straight after ASKING.
pub fn ClusterClient::new(Array[(String, &RedisConn)], ClusterTopology, limit? : Int32, dial? : async (String) -> &RedisConn raise RedisError) -> Self
A cluster client over nodes (address, connection pairs) and topology.
pub fn ClusterClient::set_topology(Self, ClusterTopology) -> Unit
Replace the routing topology (after a redirect, or on a refresh).
pub fn ClusterSlot::new(Int32, Int32, String) -> Self
A slot range [start, end] owned by node (host:port).
pub fn ClusterTopology::assign(Self, Int32, String) -> Unit
Record that slot lives on node. Singles sit ahead of the ranges, so the first match in node_for_slot is the latest word on a slot.
pub fn ClusterTopology::new(Array[ClusterSlot]) -> Self
ClusterTopology from an explicit slot list (used after parsing CLUSTER SLOTS, or in tests).
pub fn ClusterTopology::node_for_slot(Self, Int32) -> String?
The node address (host:port) that owns slot, or None if no range covers it.
pub fn crc16(Bytes) -> Int32
The CRC16-CCITT (XMODEM) of data: polynomial 0x1021, initial 0, no reflection — the checksum redis uses to place a key in a slot.
pub fn decode_cluster_slots(@resp.RespValue) -> ClusterTopology raise RedisError
Parse a CLUSTER SLOTS reply into a ClusterTopology. Each entry is [start, end, [host, port, id], ...replicas...]; the master's host:port is the owning node.
pub fn decode_info(@resp.RespValue) -> Info raise RedisError
A module INFO reply as an Info. The RESP3 map is read directly; the RESP2 flat array is read pairwise, which is how every module writes it.
pub fn expect_array(@resp.RespValue) -> Array[@resp.RespValue] raise RedisError
A reply as an Array[RespValue]: an array, or the nil an empty result decodes to.
pub fn expect_bool(@resp.RespValue) -> Bool raise RedisError
A reply as a Bool: the 1/0 redis uses for existence, success and comparison, or the boolean RESP3 sends for the same answer.
pub fn expect_bytes(@resp.RespValue) -> Bytes? raise RedisError
A reply as binary bytes, or None for the nil a missing key decodes to.
pub fn expect_double(@resp.RespValue) -> Double raise RedisError
A reply as a Double: a double, the integer a score may come back as, or a parsed decimal string.
pub fn expect_int64(@resp.RespValue) -> Int64 raise RedisError
A reply as an Int64: an integer value, or the +1/-1 a command aliases to.
pub fn expect_map(@resp.RespValue) -> Array[(@resp.RespValue, @resp.RespValue)] raise RedisError
A reply as a map (RESP3 %) of key/value pairs.
pub fn expect_number(@resp.RespValue) -> Int64 raise RedisError
A number redis writes as text: TIME, and the ports and counts of sentinel and stream replies, come back as strings under both protocols.
pub fn expect_score(@resp.RespValue) -> Double? raise RedisError
A score that may be missing: RESP3 sends a double, RESP2 a string, and both nil.
pub fn expect_some(@resp.RespValue) -> Array[@resp.RespValue] raise RedisError
The members of a reply that is one bulk value without a count and an array with one, and nothing when the key is missing.
pub fn expect_string(@resp.RespValue) -> String? raise RedisError
A reply as a String, or None for nil.
pub fn expect_string_value(@resp.RespValue) -> String raise RedisError
A reply as a String, raising on nil (for commands that always return a value).
pub fn expect_text(@resp.RespValue) -> String raise RedisError
A reply as text: a bulk string, a simple string, or a verbatim string. A module returns numbers as text on RESP2, so a call that wants the written form goes through here.
pub fn expect_text_list(@resp.RespValue) -> Array[String] raise RedisError
A list of text, from an array or the set RESP3 answers TS.QUERYINDEX with.
pub async fn FakeConn::execute(Self, Array[Bytes]) -> @resp.RespValue raise RedisError
pub async fn FakeConn::execute_all(Self, Array[Array[Bytes]]) -> Array[@resp.RespValue] raise RedisError
pub fn FakeConn::handler((Array[Bytes]) -> @resp.RespValue) -> Self
A fake that answers every call with handler, ignoring any queue.
pub fn FakeConn::new(Array[@resp.RespValue]) -> Self
A fake that returns replies in order, then Null for every further call.
pub fn FakeConn::sent(Self) -> Array[Array[Bytes]]
Every command the fake was asked to send, in order, so a test can assert the wire form a typed method builds and not only the reply it decodes.
pub fn field_value(@resp.RespValue) -> FieldValue
A reply value as a FieldValue.
pub fn FieldValue::double(Self) -> Double?
A value as a double, when it holds one.
pub fn FieldValue::int(Self) -> Int64?
A value as an integer, when it holds one.
pub fn FieldValue::text(Self) -> String?
A value as text, for the callers that only ever see text.
pub fn Fpha::text(Self) -> String
The keyword FPHA takes for this storage.
pub fn hash_slot(String) -> Int32
The slot a key hashes to. A key of the form prefix{tag}suffix hashes by tag (the hash tag), so those keys colocate; otherwise the whole key is hashed. The result is taken modulo 16384.
pub fn Info::double(Self, String) -> Double?
The value under name as a double, accepting a number or its decimal text.
pub fn Info::flag(Self, String) -> Bool?
The value under name as a flag.
pub fn Info::get(Self, String) -> InfoValue
The value stored under name, or Missing.
pub fn Info::int(Self, String) -> Int64?
The value under name as an integer, or None when it is not a whole number.
pub fn Info::text(Self, String) -> String?
The value under name as text.
pub fn info_scalar(@resp.RespValue) -> InfoValue
One value of an INFO reply: a scalar, a flag, or a null the server left empty.
pub fn is_cluster_down(String) -> Bool
Whether a redis error reply is a CLUSTERDOWN, the cluster unable to serve.
pub fn is_noscript(String) -> Bool
Whether a redis error reply is the NOSCRIPT a forgotten script digest draws, so a Script reloads and retries.
pub fn Message::parse(@resp.RespValue) -> Self?
Parse a pub/sub frame — a RESP2 array or RESP3 push — into a Message, or None if the value is not a pub/sub frame.
pub fn numeric_value(@resp.RespValue) -> Double
A numeric reply: a double, an integer, or the decimal text RESP2 writes. A module that has no value to report writes nan, which arrives as NaN here.
pub fn path_items(@resp.RespValue) -> Array[@resp.RespValue]
A reply that is one value or an array of one, as the items of an array. JSONPath commands answer with an array, the older single-path form with a bare value, and RESP3 adds a wrapper of its own; callers want neither detail.
pub fn Pipeline::add(Self, Array[Bytes]) -> Unit
Queue args as the next command.
pub async fn Pipeline::execute(Self) -> Array[@resp.RespValue] raise RedisError
Run the queued commands in one round trip. Without multi the replies come back in order, an error reply being one among them. With multi they run atomically and the EXEC result comes back: Aborted when a watched key changed, Reply when redis refused the batch, as it does for a command it could not queue.
pub fn Pipeline::multi(Self) -> Unit
Switch the pipeline to transaction mode: execute will wrap the queued commands in MULTI/EXEC.
pub fn Pipeline::new(&RedisConn) -> Self
pub fn protocol_version(Protocol) -> Int32
The HELLO version argument each protocol negotiates.
pub fn push_some(Array[Bytes], Bytes, Bytes?) -> Unit
Append an optional argument only when it is present, in a when Some arm.
pub fn redirect(String) -> Redirect?
What a MOVED or ASK error reply points at; None when the message is neither.
pub fn reply_error(@resp.RespValue) -> RedisError
The client's reply when a command returns a redis error value, or Protocol when the reply is not an error value at all but also not the shape the command expected.
pub async fn RetryConn::execute(Self, Array[Bytes]) -> @resp.RespValue raise RedisError
pub async fn RetryConn::execute_all(Self, Array[Array[Bytes]]) -> Array[@resp.RespValue] raise RedisError
pub fn RetryConn::new(&RedisConn, RetryOptions, dial? : async () -> &RedisConn raise RedisError, wait? : async (Int64) -> Unit noraise) -> Self
A retrying view of inner under retry.
pub fn same_slot(Array[String]) -> Bool
Whether every key hashes to the same slot — required for multi-key commands in a cluster.
pub fn Schema::new(Array[SchemaField]) -> Self
A schema over fields with the default index options.
pub fn SchemaField::geo(String, as_? : String, sortable? : Bool, unf? : Bool, noindex? : Bool, index_empty? : Bool, index_missing? : Bool) -> Self
pub fn SchemaField::numeric(String, as_? : String, sortable? : Bool, unf? : Bool, noindex? : Bool, index_empty? : Bool, index_missing? : Bool) -> Self
pub fn SchemaField::tag(String, as_? : String, separator? : String, case_sensitive? : Bool, sortable? : Bool, unf? : Bool, noindex? : Bool, with_suffix_trie? : Bool, index_empty? : Bool, index_missing? : Bool) -> Self
pub fn SchemaField::text(String, as_? : String, sortable? : Bool, unf? : Bool, noindex? : Bool, weight? : Double, phonetic? : String, no_stem? : Bool, with_suffix_trie? : Bool, index_empty? : Bool, index_missing? : Bool) -> Self
pub fn SchemaField::vector(String, VectorSpec, as_? : String, sortable? : Bool, noindex? : Bool) -> Self
pub fn Script::new(String) -> Self
A script of source. Nothing is sent until run.
pub async fn Script::run(Self, Client, Array[String], Array[String]) -> @resp.RespValue raise RedisError
Run the script over keys and args.
pub fn SearchHit::field(Self, String) -> String?
The field name of a hit as text, or None when the query did not return it.
pub fn SentinelClient::new(Array[&RedisConn]) -> Self
A sentinel client over sentinels (connection to each sentinel node).
pub async fn SentinelClient::resolve(Self, String) -> String raise RedisError
Resolve the master address for name, querying sentinels in order; the first answer wins. Returns the host:port string to dial.
pub fn should_retry(RedisError, Int32, RetryOptions) -> Bool
Whether an error on attempt (0-based, the attempt that just failed) is worth retrying under retry: only a transport failure, and only while attempts remain.
pub fn status_ok(@resp.RespValue) -> Unit raise RedisError
Assert a status reply (the +OK most write commands return). Any other shape is a protocol error.
pub fn TimeBound::text(Self) -> String
The -, + or decimal text a range query writes for this bound.
pub fn VectorSpec::flat(Int32, element? : String, distance? : String, initial_cap? : Int64, block_size? : Int64) -> Self
A flat (brute force) vector index over dim dimensions.
pub fn VectorSpec::hnsw(Int32, element? : String, distance? : String, initial_cap? : Int64, m? : Int64, ef_construction? : Int64, ef_runtime? : Int64, epsilon? : Double) -> Self
An HNSW vector index over dim dimensions.
Implementations 2
pub impl RedisConn for FakeConn
A live redis connection: it sends an encoded command (an array of argument byte strings) and returns the decoded reply. Implementations own the transport — a real socket speaking RESP, or an in-memory fake. It is open and async so a socket can be one: real redis I/O suspends, and a sealed synchronous trait left every implementation a test double.
pub impl RedisConn for RetryConn
A live redis connection: it sends an encoded command (an array of argument byte strings) and returns the decoded reply. Implementations own the transport — a real socket speaking RESP, or an in-memory fake. It is open and async so a socket can be one: real redis I/O suspends, and a sealed synchronous trait left every implementation a test double.
Derived members33
pub fn FieldValue::equal(Self, Self) -> Bool
pub fn FieldValue::not_equal(Self, Self) -> Bool
pub fn FieldValue::to_repr(Self) -> @debug.Repr
pub fn Fpha::equal(Self, Self) -> Bool
pub fn Fpha::not_equal(Self, Self) -> Bool
pub fn Fpha::to_repr(Self) -> @debug.Repr
pub fn Fusion::equal(Self, Self) -> Bool
pub fn Fusion::not_equal(Self, Self) -> Bool
pub fn Fusion::to_repr(Self) -> @debug.Repr
pub fn IndexKind::equal(Self, Self) -> Bool
pub fn IndexKind::not_equal(Self, Self) -> Bool
pub fn IndexKind::to_repr(Self) -> @debug.Repr
pub fn InfoValue::equal(Self, Self) -> Bool
pub fn InfoValue::not_equal(Self, Self) -> Bool
pub fn InfoValue::to_repr(Self) -> @debug.Repr
pub fn Redirect::equal(Self, Self) -> Bool
pub fn Redirect::not_equal(Self, Self) -> Bool
pub fn Redirect::to_repr(Self) -> @debug.Repr
pub fn RedisError::equal(Self, Self) -> Bool
pub fn RedisError::not_equal(Self, Self) -> Bool
pub fn RedisError::to_repr(Self) -> @debug.Repr
pub fn Sample::equal(Self, Self) -> Bool
pub fn Sample::not_equal(Self, Self) -> Bool
pub fn Sample::to_repr(Self) -> @debug.Repr
pub fn SchemaKind::equal(Self, Self) -> Bool
pub fn SchemaKind::not_equal(Self, Self) -> Bool
pub fn SchemaKind::to_repr(Self) -> @debug.Repr
pub fn TimeBound::equal(Self, Self) -> Bool
pub fn TimeBound::not_equal(Self, Self) -> Bool
pub fn TimeBound::to_repr(Self) -> @debug.Repr
pub fn VectorAlgorithm::equal(Self, Self) -> Bool
pub fn VectorAlgorithm::not_equal(Self, Self) -> Bool
pub fn VectorAlgorithm::to_repr(Self) -> @debug.Repr