rustis 0.23.0

Redis async driver for Rust
Documentation
/*!
Define Redis built-in commands in a set of traits

# Built-in commands

Because Redis offers hundreds of commands, in **rustis** commands have been split in several traits that gather commands by groups,
most of the time, groups describe in [Redis official documentation](https://redis.io/commands/).

Depending on the group of commands, traits will be implemented by [`Client`](crate::client::Client),
[`Pipeline`](crate::client::Pipeline), [`Transaction`](crate::client::Transaction) or some of these structs.

These is the list of existing command traits:
* [`ArrayCommands`] — [Arrays](https://redis.io/docs/latest/commands/?group=array), the sparse index-addressed type introduced in Redis 8.8
* [`BitmapCommands`] — [Bitmaps](https://redis.io/docs/data-types/bitmaps/) & [Bitfields](https://redis.io/docs/data-types/bitfields/)
* [`BlockingCommands`] — commands that block the connection until the Redis server
  has a new element to send. Implemented only by [`ExclusiveClient`](crate::client::ExclusiveClient),
  which owns its connection.
* [`ClusterCommands`] — [Redis cluster](https://redis.io/docs/reference/cluster-spec/)
* [`ConnectionCommands`] — connection management like authentication or RESP version management
* [`GenericCommands`] — generic commands like deleting, renaming or expiring keys
* [`GeoCommands`] — [Geospatial](https://redis.io/docs/data-types/geospatial/) indices
* [`HashCommands`] — [Hashes](https://redis.io/docs/data-types/hashes/)
* [`HyperLogLogCommands`] — [HyperLogLog](https://redis.io/docs/data-types/hyperloglogs/)
* [`ListCommands`] — [Lists](https://redis.io/docs/data-types/lists/)
* [`PubSubCommands`] — [Pub/Sub](https://redis.io/docs/manual/pubsub/)
* [`ScriptingCommands`] — [Scripts](https://redis.io/docs/manual/programmability/eval-intro/) &
  [Functions](https://redis.io/docs/manual/programmability/functions-intro/)
* [`SentinelCommands`] — [Sentinel](https://redis.io/docs/management/sentinel/)
* [`ServerCommands`] — server management like [Access Control Lists](https://redis.io/docs/management/security/acl/) or monitoring
* [`SetCommands`] — [Sets](https://redis.io/docs/data-types/sets/)
* [`SortedSetCommands`] — [Sorted sets](https://redis.io/docs/data-types/sorted-sets/)
* [`StreamCommands`] — [Streams](https://redis.io/docs/data-types/streams/)
* [`StringCommands`] — [Strings](https://redis.io/docs/data-types/strings/)
* [`VectorSetCommands`] — [Vector sets](https://redis.io/docs/data-types/vector-sets/)
* [`TransactionCommands`] — `WATCH`/`UNWATCH`, the optimistic locking half of
  [Transactions](https://redis.io/docs/manual/transactions/). Implemented only by
  [`ExclusiveClient`](crate::client::ExclusiveClient), the watched state being a property
  of the connection; `MULTI`/`EXEC` are reached through
  [`Client::create_transaction`](crate::client::Client::create_transaction).
* [`BloomCommands`] — [Bloom filters](https://redis.io/docs/stack/bloom/)
* [`CuckooCommands`] — [Cuckoo filters](https://redis.io/docs/stack/bloom/)
* [`CountMinSketchCommands`] — [Count min-sketch](https://redis.io/docs/stack/bloom/)
* [`JsonCommands`] — [RedisJson](https://redis.io/docs/stack/json/)
* [`SearchCommands`] — [RedisSearch](https://redis.io/docs/stack/search/)
* [`TDigestCommands`] — [T-Digest](https://redis.io/docs/stack/bloom/)
* [`TimeSeriesCommands`] — [Time Series](https://redis.io/docs/stack/timeseries/)
* [`TopKCommands`] — [Top-K](https://redis.io/docs/stack/bloom/)

# Command coverage

Every command documented on [redis.io](https://redis.io/commands/) up to and
including **Redis 8.8** is implemented, together with its options — including
the commands of the bundled modules (RediSearch, RedisJSON, RedisTimeSeries,
RedisBloom, vector sets).

Three families are left out on purpose.

**Deprecated commands.** Their modern replacement is implemented instead, so
there is one way to do each thing rather than two:

| Deprecated | Use instead |
|---|---|
| `ZREVRANGE`, `ZRANGEBYSCORE`, `ZRANGEBYLEX`, `ZREVRANGEBYSCORE`, `ZREVRANGEBYLEX` | [`zrange`](SortedSetCommands::zrange) with [`ZRangeOptions`] |
| `RPOPLPUSH`, `BRPOPLPUSH` | [`lmove`](ListCommands::lmove), [`blmove`](BlockingCommands::blmove) |
| `GEORADIUS`, `GEORADIUSBYMEMBER`, and their `_RO` variants | [`geosearch`](GeoCommands::geosearch) |
| `HMSET` | [`hset`](HashCommands::hset) |
| `SLAVEOF` | [`replicaof`](ServerCommands::replicaof) |
| `CLUSTER SLAVES` | [`cluster_replicas`](ClusterCommands::cluster_replicas) |
| `FT.ADD`, `FT.DEL`, `FT.GET`, `FT.MGET`, `FT.DROP`, `FT.SAFEADD`, `FT.SYNADD` | the hash/JSON document model ([`ft_create`](SearchCommands::ft_create), [`ft_search`](SearchCommands::ft_search)) |

**Server-internal commands**, such as `PSYNC`, `SYNC`, `REPLCONF`,
`RESTORE-ASKING`, `PFDEBUG`, `BF.DEBUG`, `CF.DEBUG` or `_FT.DEBUG`. These belong
to the server-to-server or debugging surface; issuing them from a client can
corrupt replication or cluster state.

**Commands the server declares unstable.** The `COLLECT` reducer of
`FT.AGGREGATE` and `FT.HYBRID` is documented, but the search module refuses it
unless `search-enable-unstable-features` is set to `yes` — which means Redis
reserves the right to change its grammar and its reply. It is not exposed while
that is the case, rather than pin a public API to an interface its own vendor
calls provisional.

Note also that a handful of commands appear in `COMMAND LIST` without being
public API — a module's private surface, recognizable by the absence of any
documentation page. Those are not implemented either.

Transactions need no `DISCARD`: a [`Transaction`](crate::client::Transaction) is
buffered client-side and sent as a single `MULTI` … `EXEC` batch when
[`execute`](crate::client::Transaction::execute) is called, so abandoning one is
simply dropping it — nothing has reached the server yet.

# Example

To use a command, simply add the related trait to your `use` declerations
and call the related associated function directly to a client, pipeline, transaction instance.

Commands can be directly awaited or [forgotten](crate::client::ClientPreparedCommand::forget).

```
use rustis::{
    client::{Client, ClientPreparedCommand},
    commands::{ListCommands, SortedSetCommands, ZAddOptions},
    Result,
};

#[tokio::main]
async fn main() -> Result<()> {
    let client = Client::connect("127.0.0.1:6379").await?;

    // Send & await ListCommands::lpush command
    let _size = client.lpush("mylist", ["element1", "element2"]).await?;

    // Send & forget SortedSetCommands::zadd command
    let _size = client.zadd(
        "mySortedSet",
        [(1.0, "member1"), (2.0, "member2")],
        ZAddOptions::default()
    ).forget();

    Ok(())
}
```

# Documentation disclaimer

The commands traits documentation is directly adapated from the official Redis
documentation found [here](https://github.com/redis/redis-doc) with the
following [COPYRIGHT](https://github.com/redis/redis-doc/blob/master/COPYRIGHT).
*/

mod array_commands;
mod bitmap_commands;
mod blocking_commands;
mod bloom_commands;
mod cluster_commands;
mod connection_commands;
mod count_min_sktech_commands;
mod cuckoo_commands;
#[cfg(test)]
mod debug_commands;
mod generic_commands;
mod geo_commands;
mod hash_commands;
mod hyper_log_log_commands;
mod internal_pub_sub_commands;
mod json_commands;
mod list_commands;
mod pub_sub_commands;
mod scripting_commands;
mod search_commands;
mod sentinel_commands;
mod server_commands;
mod set_commands;
mod sorted_set_commands;
mod stream_commands;
mod string_commands;
mod t_disgest_commands;
mod time_series_commands;
mod top_k_commands;
mod transaction_commands;
mod vector_set;

pub use array_commands::*;
pub use bitmap_commands::*;
pub use blocking_commands::*;
pub use bloom_commands::*;
pub use cluster_commands::*;
pub use connection_commands::*;
pub use count_min_sktech_commands::*;
pub use cuckoo_commands::*;
#[cfg(test)]
pub use debug_commands::*;
pub use generic_commands::*;
pub use geo_commands::*;
pub use hash_commands::*;
pub use hyper_log_log_commands::*;
pub(crate) use internal_pub_sub_commands::*;
pub use json_commands::*;
pub use list_commands::*;
pub use pub_sub_commands::*;
pub use scripting_commands::*;
pub use search_commands::*;
pub use sentinel_commands::*;
pub use server_commands::*;
pub use set_commands::*;
pub use sorted_set_commands::*;
pub use stream_commands::*;
pub use string_commands::*;
pub use t_disgest_commands::*;
pub use time_series_commands::*;
pub use top_k_commands::*;
pub use transaction_commands::*;
pub use vector_set::*;