@@ -111,7 +111,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
111
111
T : Indexed ,
112
112
T :: IndexedType : DeserializeOwned ,
113
113
T :: Error : AsyncErrorDeps ,
114
- K : IndexedKeyBounds < T > + Serialize ,
114
+ K : IndexedKey < T > + Serialize ,
115
115
{
116
116
let range = self . serializer . encode_key_range :: < T , K > ( room_id, range) ?;
117
117
let object_store = self . transaction . object_store ( T :: OBJECT_STORE ) ?;
@@ -141,7 +141,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
141
141
T : Indexed + ' b ,
142
142
T :: IndexedType : DeserializeOwned ,
143
143
T :: Error : AsyncErrorDeps ,
144
- K : IndexedKeyComponentBounds < T > + Serialize + ' b ,
144
+ K : IndexedKey < T > + Serialize + ' b ,
145
145
{
146
146
let range: IndexedKeyRange < K > = range. into ( ) . encoded ( room_id, self . serializer . inner ( ) ) ;
147
147
self . get_items_by_key :: < T , K > ( room_id, range) . await
@@ -158,7 +158,11 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
158
158
T :: Error : AsyncErrorDeps ,
159
159
K : IndexedKeyBounds < T > + Serialize ,
160
160
{
161
- self . get_items_by_key :: < T , K > ( room_id, IndexedKeyRange :: All ) . await
161
+ self . get_items_by_key :: < T , K > (
162
+ room_id,
163
+ IndexedKeyRange :: all ( room_id, self . serializer . inner ( ) ) ,
164
+ )
165
+ . await
162
166
}
163
167
164
168
/// Query IndexedDB for items that match the given key in the given room. If
@@ -172,7 +176,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
172
176
T : Indexed ,
173
177
T :: IndexedType : DeserializeOwned ,
174
178
T :: Error : AsyncErrorDeps ,
175
- K : IndexedKeyBounds < T > + Serialize ,
179
+ K : IndexedKey < T > + Serialize ,
176
180
{
177
181
let mut items = self . get_items_by_key :: < T , K > ( room_id, key) . await ?;
178
182
if items. len ( ) > 1 {
@@ -192,7 +196,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
192
196
T : Indexed + ' b ,
193
197
T :: IndexedType : DeserializeOwned ,
194
198
T :: Error : AsyncErrorDeps ,
195
- K : IndexedKeyComponentBounds < T > + Serialize + ' b ,
199
+ K : IndexedKey < T > + Serialize + ' b ,
196
200
{
197
201
let mut items = self . get_items_by_key_components :: < T , K > ( room_id, components) . await ?;
198
202
if items. len ( ) > 1 {
@@ -212,7 +216,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
212
216
T : Indexed ,
213
217
T :: IndexedType : DeserializeOwned ,
214
218
T :: Error : AsyncErrorDeps ,
215
- K : IndexedKeyBounds < T > + Serialize ,
219
+ K : IndexedKey < T > + Serialize ,
216
220
{
217
221
let range = self . serializer . encode_key_range :: < T , K > ( room_id, range) ?;
218
222
let object_store = self . transaction . object_store ( T :: OBJECT_STORE ) ?;
@@ -235,7 +239,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
235
239
T : Indexed + ' b ,
236
240
T :: IndexedType : DeserializeOwned ,
237
241
T :: Error : AsyncErrorDeps ,
238
- K : IndexedKeyBounds < T > + Serialize + ' b ,
242
+ K : IndexedKey < T > + Serialize + ' b ,
239
243
{
240
244
let range: IndexedKeyRange < K > = range. into ( ) . encoded ( room_id, self . serializer . inner ( ) ) ;
241
245
self . get_items_count_by_key :: < T , K > ( room_id, range) . await
@@ -252,7 +256,11 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
252
256
T :: Error : AsyncErrorDeps ,
253
257
K : IndexedKeyBounds < T > + Serialize ,
254
258
{
255
- self . get_items_count_by_key :: < T , K > ( room_id, IndexedKeyRange :: All ) . await
259
+ self . get_items_count_by_key :: < T , K > (
260
+ room_id,
261
+ IndexedKeyRange :: all ( room_id, self . serializer . inner ( ) ) ,
262
+ )
263
+ . await
256
264
}
257
265
258
266
/// Query IndexedDB for the item with the maximum key in the given room.
@@ -264,9 +272,12 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
264
272
T : Indexed ,
265
273
T :: IndexedType : DeserializeOwned ,
266
274
T :: Error : AsyncErrorDeps ,
267
- K : IndexedKey < T > + IndexedKeyBounds < T > + Serialize ,
275
+ K : IndexedKeyBounds < T > + Serialize ,
268
276
{
269
- let range = self . serializer . encode_key_range :: < T , K > ( room_id, IndexedKeyRange :: All ) ?;
277
+ let range = self . serializer . encode_key_range :: < T , K > (
278
+ room_id,
279
+ IndexedKeyRange :: all ( room_id, self . serializer . inner ( ) ) ,
280
+ ) ?;
270
281
let direction = IdbCursorDirection :: Prev ;
271
282
let object_store = self . transaction . object_store ( T :: OBJECT_STORE ) ?;
272
283
if let Some ( index) = K :: INDEX {
@@ -339,7 +350,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
339
350
) -> Result < ( ) , IndexeddbEventCacheStoreTransactionError >
340
351
where
341
352
T : Indexed ,
342
- K : IndexedKeyBounds < T > + Serialize ,
353
+ K : IndexedKey < T > + Serialize ,
343
354
{
344
355
let range = self . serializer . encode_key_range :: < T , K > ( room_id, range) ?;
345
356
let object_store = self . transaction . object_store ( T :: OBJECT_STORE ) ?;
@@ -366,7 +377,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
366
377
) -> Result < ( ) , IndexeddbEventCacheStoreTransactionError >
367
378
where
368
379
T : Indexed + ' b ,
369
- K : IndexedKeyBounds < T > + Serialize + ' b ,
380
+ K : IndexedKey < T > + Serialize + ' b ,
370
381
{
371
382
let range: IndexedKeyRange < K > = range. into ( ) . encoded ( room_id, self . serializer . inner ( ) ) ;
372
383
self . delete_items_by_key :: < T , K > ( room_id, range) . await
@@ -381,7 +392,11 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
381
392
T : Indexed ,
382
393
K : IndexedKeyBounds < T > + Serialize ,
383
394
{
384
- self . delete_items_by_key :: < T , K > ( room_id, IndexedKeyRange :: All ) . await
395
+ self . delete_items_by_key :: < T , K > (
396
+ room_id,
397
+ IndexedKeyRange :: all ( room_id, self . serializer . inner ( ) ) ,
398
+ )
399
+ . await
385
400
}
386
401
387
402
/// Delete item that matches the given key components in the given room from
@@ -393,7 +408,7 @@ impl<'a> IndexeddbEventCacheStoreTransaction<'a> {
393
408
) -> Result < ( ) , IndexeddbEventCacheStoreTransactionError >
394
409
where
395
410
T : Indexed + ' b ,
396
- K : IndexedKeyBounds < T > + Serialize + ' b ,
411
+ K : IndexedKey < T > + Serialize + ' b ,
397
412
{
398
413
self . delete_items_by_key_components :: < T , K > ( room_id, key) . await
399
414
}
0 commit comments