Skip to content

Commit fe06822

Browse files
Merge branch 'redis-rs:main' into main
2 parents 23388b8 + 60daaa7 commit fe06822

File tree

7 files changed

+535
-18
lines changed

7 files changed

+535
-18
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The crate is called `redis` and you can depend on it via cargo:
1414

1515
```ini
1616
[dependencies]
17-
redis = "0.27.0"
17+
redis = "0.27.3"
1818
```
1919

2020
Documentation on the library can be found at
@@ -57,10 +57,10 @@ To enable asynchronous clients, enable the relevant feature in your Cargo.toml,
5757

5858
```
5959
# if you use tokio
60-
redis = { version = "0.27.0", features = ["tokio-comp"] }
60+
redis = { version = "0.27.3", features = ["tokio-comp"] }
6161
6262
# if you use async-std
63-
redis = { version = "0.27.0", features = ["async-std-comp"] }
63+
redis = { version = "0.27.3", features = ["async-std-comp"] }
6464
```
6565

6666
## TLS Support
@@ -71,25 +71,25 @@ Currently, `native-tls` and `rustls` are supported.
7171
To use `native-tls`:
7272

7373
```
74-
redis = { version = "0.27.0", features = ["tls-native-tls"] }
74+
redis = { version = "0.27.3", features = ["tls-native-tls"] }
7575
7676
# if you use tokio
77-
redis = { version = "0.27.0", features = ["tokio-native-tls-comp"] }
77+
redis = { version = "0.27.3", features = ["tokio-native-tls-comp"] }
7878
7979
# if you use async-std
80-
redis = { version = "0.27.0", features = ["async-std-native-tls-comp"] }
80+
redis = { version = "0.27.3", features = ["async-std-native-tls-comp"] }
8181
```
8282

8383
To use `rustls`:
8484

8585
```
86-
redis = { version = "0.27.0", features = ["tls-rustls"] }
86+
redis = { version = "0.27.3", features = ["tls-rustls"] }
8787
8888
# if you use tokio
89-
redis = { version = "0.27.0", features = ["tokio-rustls-comp"] }
89+
redis = { version = "0.27.3", features = ["tokio-rustls-comp"] }
9090
9191
# if you use async-std
92-
redis = { version = "0.27.0", features = ["async-std-rustls-comp"] }
92+
redis = { version = "0.27.3", features = ["async-std-rustls-comp"] }
9393
```
9494

9595
With `rustls`, you can add the following feature flags on top of other feature flags to enable additional features:
@@ -115,7 +115,7 @@ let client = redis::Client::open("rediss://127.0.0.1/#insecure")?;
115115

116116
Support for Redis Cluster can be enabled by enabling the `cluster` feature in your Cargo.toml:
117117

118-
`redis = { version = "0.27.0", features = [ "cluster"] }`
118+
`redis = { version = "0.27.3", features = [ "cluster"] }`
119119

120120
Then you can simply use the `ClusterClient`, which accepts a list of available nodes. Note
121121
that only one node in the cluster needs to be specified when instantiating the client, though
@@ -138,7 +138,7 @@ fn fetch_an_integer() -> String {
138138
Async Redis Cluster support can be enabled by enabling the `cluster-async` feature, along
139139
with your preferred async runtime, e.g.:
140140

141-
`redis = { version = "0.27.0", features = [ "cluster-async", "tokio-std-comp" ] }`
141+
`redis = { version = "0.27.3", features = [ "cluster-async", "tokio-std-comp" ] }`
142142

143143
```rust
144144
use redis::cluster::ClusterClient;
@@ -158,7 +158,7 @@ async fn fetch_an_integer() -> String {
158158

159159
Support for the RedisJSON Module can be enabled by specifying "json" as a feature in your Cargo.toml.
160160

161-
`redis = { version = "0.27.0", features = ["json"] }`
161+
`redis = { version = "0.27.3", features = ["json"] }`
162162

163163
Then you can simply import the `JsonCommands` trait which will add the `json` commands to all Redis Connections (not to be confused with just `Commands` which only adds the default commands)
164164

redis/CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### 0.27.3 (2024-10-01)
2+
3+
#### Changes & Bug fixes
4+
5+
* Add support for [TYPE type] in SCAN commands ([#1332](https://github.com/redis-rs/redis-rs/pull/1332) @Reiuji-ch)
6+
* Align default timeouts on cluster client. ([#1333](https://github.com/redis-rs/redis-rs/pull/1333))
7+
* Updates unmaintained tokio-retry to tokio-retry2 ([#1334](https://github.com/redis-rs/redis-rs/pull/1334) @naomijub)
8+
* Align verification of protocol & TLS during cluster creation. ([#1289](https://github.com/redis-rs/redis-rs/pull/1289))
9+
* Include the StreamExt use statement in docs ([#1345](https://github.com/redis-rs/redis-rs/pull/1345) @joshrotenberg)
10+
* Further limit parser recursion ([#1346](https://github.com/redis-rs/redis-rs/pull/1346))
11+
12+
#### CI improvements
13+
14+
* Improve testing async-std ([#1314](https://github.com/redis-rs/redis-rs/pull/1314))
15+
* Test against Valkey in CI. ([#1315](https://github.com/redis-rs/redis-rs/pull/1315))
16+
* Add CI action to test whether feature combinations compile. ([#1328](https://github.com/redis-rs/redis-rs/pull/1328))
17+
118
### 0.27.2 (2024-09-14)
219

320
#### Changes & Bug fixes

redis/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "redis"
3-
version = "0.27.2"
3+
version = "0.27.3"
44
keywords = ["redis", "database"]
55
description = "Redis driver for Rust."
66
homepage = "https://github.com/redis-rs/redis-rs"

redis/src/commands/mod.rs

+51-1
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,42 @@ implement_commands! {
14201420
cmd("XADD").arg(key).arg(id).arg(map)
14211421
}
14221422

1423+
1424+
/// Add a stream message with options.
1425+
///
1426+
/// Items can be any list type, e.g.
1427+
/// ```rust
1428+
/// // static items
1429+
/// let items = &[("key", "val"), ("key2", "val2")];
1430+
/// # use std::collections::BTreeMap;
1431+
/// // A map (Can be BTreeMap, HashMap, etc)
1432+
/// let mut map: BTreeMap<&str, &str> = BTreeMap::new();
1433+
/// map.insert("ab", "cd");
1434+
/// map.insert("ef", "gh");
1435+
/// map.insert("ij", "kl");
1436+
/// ```
1437+
///
1438+
/// ```text
1439+
/// XADD key [NOMKSTREAM] [<MAXLEN|MINID> [~|=] threshold [LIMIT count]] <* | ID> field value [field value] ...
1440+
/// ```
1441+
#[cfg(feature = "streams")]
1442+
#[cfg_attr(docsrs, doc(cfg(feature = "streams")))]
1443+
fn xadd_options<
1444+
K: ToRedisArgs, ID: ToRedisArgs, I: ToRedisArgs
1445+
>(
1446+
key: K,
1447+
id: ID,
1448+
items: I,
1449+
options: &'a streams::StreamAddOptions
1450+
) {
1451+
cmd("XADD")
1452+
.arg(key)
1453+
.arg(options)
1454+
.arg(id)
1455+
.arg(items)
1456+
}
1457+
1458+
14231459
/// Add a stream message while capping the stream at a maxlength.
14241460
///
14251461
/// ```text
@@ -1563,7 +1599,7 @@ implement_commands! {
15631599
/// ```text
15641600
/// XCLAIM <key> <group> <consumer> <min-idle-time> <ID-1> <ID-2>
15651601
/// [IDLE <milliseconds>] [TIME <mstime>] [RETRYCOUNT <count>]
1566-
/// [FORCE] [JUSTID]
1602+
/// [FORCE] [JUSTID] [LASTID <lastid>]
15671603
/// ```
15681604
#[cfg(feature = "streams")]
15691605
#[cfg_attr(docsrs, doc(cfg(feature = "streams")))]
@@ -2085,6 +2121,20 @@ implement_commands! {
20852121
cmd("XTRIM").arg(key).arg(maxlen)
20862122
}
20872123

2124+
/// Trim a stream `key` with full options
2125+
///
2126+
/// ```text
2127+
/// XTRIM <key> <MAXLEN|MINID> [~|=] <threshold> [LIMIT <count>] (Same as XADD MAXID|MINID options)
2128+
/// ```
2129+
#[cfg(feature = "streams")]
2130+
#[cfg_attr(docsrs, doc(cfg(feature = "streams")))]
2131+
fn xtrim_options<K: ToRedisArgs>(
2132+
key: K,
2133+
options: &'a streams::StreamTrimOptions
2134+
) {
2135+
cmd("XTRIM").arg(key).arg(options)
2136+
}
2137+
20882138
// script commands
20892139

20902140
/// Adds a prepared script command to the pipeline.

0 commit comments

Comments
 (0)