@@ -46,7 +46,7 @@ extension RedisClient {
46
46
/// - key: The key of the hash to delete from.
47
47
/// - Returns: The number of fields that were deleted.
48
48
@inlinable
49
- public func hdel( _ fields: [ String ] , from key: String ) -> EventLoopFuture < Int > {
49
+ public func hdel( _ fields: [ String ] , from key: RedisKey ) -> EventLoopFuture < Int > {
50
50
guard fields. count > 0 else { return self . eventLoop. makeSucceededFuture ( 0 ) }
51
51
52
52
var args : [ RESPValue ] = [ . init( bulk: key) ]
@@ -64,7 +64,7 @@ extension RedisClient {
64
64
/// - key: The key of the hash to delete from.
65
65
/// - Returns: The number of fields that were deleted.
66
66
@inlinable
67
- public func hdel( _ fields: String ... , from key: String ) -> EventLoopFuture < Int > {
67
+ public func hdel( _ fields: String ... , from key: RedisKey ) -> EventLoopFuture < Int > {
68
68
return self . hdel ( fields, from: key)
69
69
}
70
70
@@ -76,7 +76,7 @@ extension RedisClient {
76
76
/// - key: The key of the hash to look within.
77
77
/// - Returns: `true` if the hash contains the field, `false` if either the key or field do not exist.
78
78
@inlinable
79
- public func hexists( _ field: String , in key: String ) -> EventLoopFuture < Bool > {
79
+ public func hexists( _ field: String , in key: RedisKey ) -> EventLoopFuture < Bool > {
80
80
let args : [ RESPValue ] = [
81
81
. init( bulk: key) ,
82
82
. init( bulk: field)
@@ -92,7 +92,7 @@ extension RedisClient {
92
92
/// - Parameter key: The key of the hash to get field count of.
93
93
/// - Returns: The number of fields in the hash, or `0` if the key doesn't exist.
94
94
@inlinable
95
- public func hlen( of key: String ) -> EventLoopFuture < Int > {
95
+ public func hlen( of key: RedisKey ) -> EventLoopFuture < Int > {
96
96
let args = [ RESPValue ( bulk: key) ]
97
97
return send ( command: " HLEN " , with: args)
98
98
. convertFromRESPValue ( )
@@ -106,7 +106,7 @@ extension RedisClient {
106
106
/// - key: The key of the hash.
107
107
/// - Returns: The string length of the hash field's value, or `0` if the field or hash do not exist.
108
108
@inlinable
109
- public func hstrlen( of field: String , in key: String ) -> EventLoopFuture < Int > {
109
+ public func hstrlen( of field: String , in key: RedisKey ) -> EventLoopFuture < Int > {
110
110
let args : [ RESPValue ] = [
111
111
. init( bulk: key) ,
112
112
. init( bulk: field)
@@ -121,7 +121,7 @@ extension RedisClient {
121
121
/// - Parameter key: The key of the hash.
122
122
/// - Returns: A list of field names stored within the hash.
123
123
@inlinable
124
- public func hkeys( in key: String ) -> EventLoopFuture < [ String ] > {
124
+ public func hkeys( in key: RedisKey ) -> EventLoopFuture < [ String ] > {
125
125
let args = [ RESPValue ( bulk: key) ]
126
126
return send ( command: " HKEYS " , with: args)
127
127
. convertFromRESPValue ( )
@@ -133,7 +133,7 @@ extension RedisClient {
133
133
/// - Parameter key: The key of the hash.
134
134
/// - Returns: A list of all values stored in a hash.
135
135
@inlinable
136
- public func hvals( in key: String ) -> EventLoopFuture < [ RESPValue ] > {
136
+ public func hvals( in key: RedisKey ) -> EventLoopFuture < [ RESPValue ] > {
137
137
let args = [ RESPValue ( bulk: key) ]
138
138
return send ( command: " HVALS " , with: args)
139
139
. convertFromRESPValue ( )
@@ -150,7 +150,7 @@ extension RedisClient {
150
150
/// - Returns: A cursor position for additional invocations with a limited collection of found fields and their values.
151
151
@inlinable
152
152
public func hscan(
153
- _ key: String ,
153
+ _ key: RedisKey ,
154
154
startingFrom position: Int = 0 ,
155
155
count: Int ? = nil ,
156
156
matching match: String ? = nil
@@ -179,7 +179,7 @@ extension RedisClient {
179
179
public func hset< Value: RESPValueConvertible > (
180
180
_ field: String ,
181
181
to value: Value ,
182
- in key: String
182
+ in key: RedisKey
183
183
) -> EventLoopFuture < Bool > {
184
184
let args : [ RESPValue ] = [
185
185
. init( bulk: key) ,
@@ -204,7 +204,7 @@ extension RedisClient {
204
204
public func hsetnx< Value: RESPValueConvertible > (
205
205
_ field: String ,
206
206
to value: Value ,
207
- in key: String
207
+ in key: RedisKey
208
208
) -> EventLoopFuture < Bool > {
209
209
let args : [ RESPValue ] = [
210
210
. init( bulk: key) ,
@@ -226,7 +226,7 @@ extension RedisClient {
226
226
@inlinable
227
227
public func hmset< Value: RESPValueConvertible > (
228
228
_ fields: [ String : Value ] ,
229
- in key: String
229
+ in key: RedisKey
230
230
) -> EventLoopFuture < Void > {
231
231
assert ( fields. count > 0 , " At least 1 key-value pair should be specified " )
232
232
@@ -252,7 +252,7 @@ extension RedisClient {
252
252
/// - key: The key of the hash being accessed.
253
253
/// - Returns: The value of the hash field, or `nil` if either the key or field does not exist.
254
254
@inlinable
255
- public func hget( _ field: String , from key: String ) -> EventLoopFuture < String ? > {
255
+ public func hget( _ field: String , from key: RedisKey ) -> EventLoopFuture < String ? > {
256
256
let args : [ RESPValue ] = [
257
257
. init( bulk: key) ,
258
258
. init( bulk: field)
@@ -269,7 +269,7 @@ extension RedisClient {
269
269
/// - key: The key of the hash being accessed.
270
270
/// - Returns: A list of values in the same order as the `fields` argument. Non-existent fields return `nil` values.
271
271
@inlinable
272
- public func hmget( _ fields: [ String ] , from key: String ) -> EventLoopFuture < [ String ? ] > {
272
+ public func hmget( _ fields: [ String ] , from key: RedisKey ) -> EventLoopFuture < [ String ? ] > {
273
273
guard fields. count > 0 else { return self . eventLoop. makeSucceededFuture ( [ ] ) }
274
274
275
275
var args : [ RESPValue ] = [ . init( bulk: key) ]
@@ -288,7 +288,7 @@ extension RedisClient {
288
288
/// - key: The key of the hash being accessed.
289
289
/// - Returns: A list of values in the same order as the `fields` argument. Non-existent fields return `nil` values.
290
290
@inlinable
291
- public func hmget( _ fields: String ... , from key: String ) -> EventLoopFuture < [ String ? ] > {
291
+ public func hmget( _ fields: String ... , from key: RedisKey ) -> EventLoopFuture < [ String ? ] > {
292
292
return self . hmget ( fields, from: key)
293
293
}
294
294
@@ -298,7 +298,7 @@ extension RedisClient {
298
298
/// - Parameter key: The key of the hash to pull from.
299
299
/// - Returns: A key-value pair list of fields and their values.
300
300
@inlinable
301
- public func hgetall( from key: String ) -> EventLoopFuture < [ String : String ] > {
301
+ public func hgetall( from key: RedisKey ) -> EventLoopFuture < [ String : String ] > {
302
302
let args = [ RESPValue ( bulk: key) ]
303
303
return send ( command: " HGETALL " , with: args)
304
304
. convertFromRESPValue ( to: [ String ] . self)
@@ -318,7 +318,7 @@ extension RedisClient {
318
318
/// - key: The key of the hash the field is stored in.
319
319
/// - Returns: The new value of the hash field.
320
320
@inlinable
321
- public func hincrby( _ amount: Int , field: String , in key: String ) -> EventLoopFuture < Int > {
321
+ public func hincrby( _ amount: Int , field: String , in key: RedisKey ) -> EventLoopFuture < Int > {
322
322
return _hincr ( command: " HINCRBY " , amount, field, key)
323
323
}
324
324
@@ -331,7 +331,7 @@ extension RedisClient {
331
331
/// - key: The key of the hash the field is stored in.
332
332
/// - Returns: The new value of the hash field.
333
333
@inlinable
334
- public func hincrbyfloat< Value> ( _ amount: Value , field: String , in key: String ) -> EventLoopFuture < Value >
334
+ public func hincrbyfloat< Value> ( _ amount: Value , field: String , in key: RedisKey ) -> EventLoopFuture < Value >
335
335
where
336
336
Value: BinaryFloatingPoint ,
337
337
Value: RESPValueConvertible
@@ -344,7 +344,7 @@ extension RedisClient {
344
344
command: String ,
345
345
_ amount: Value ,
346
346
_ field: String ,
347
- _ key: String
347
+ _ key: RedisKey
348
348
) -> EventLoopFuture < Value > {
349
349
let args : [ RESPValue ] = [
350
350
. init( bulk: key) ,
0 commit comments