@@ -242,7 +242,7 @@ where
242
242
) -> Result < CollectionHeader < Cl :: PrimaryKey > , crate :: Error >
243
243
where
244
244
Cl : schema:: SerializedCollection ,
245
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ?Sized ,
245
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ?Sized ,
246
246
{
247
247
let contents = Cl :: serialize ( item) ?;
248
248
self . connection . insert :: < Cl , _ , _ > ( Some ( id) , contents)
@@ -268,7 +268,7 @@ where
268
268
contents : B ,
269
269
) -> Result < CollectionHeader < Cl :: PrimaryKey > , crate :: Error >
270
270
where
271
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ?Sized ,
271
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ?Sized ,
272
272
{
273
273
self . connection . insert :: < Cl , _ , B > ( Some ( id) , contents)
274
274
}
@@ -331,7 +331,7 @@ where
331
331
/// ```
332
332
pub fn get < PrimaryKey > ( & self , id : & PrimaryKey ) -> Result < Option < OwnedDocument > , Error >
333
333
where
334
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ?Sized ,
334
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ?Sized ,
335
335
{
336
336
self . connection . get :: < Cl , _ > ( id)
337
337
}
@@ -358,7 +358,7 @@ where
358
358
where
359
359
DocumentIds : IntoIterator < Item = & ' id PrimaryKey , IntoIter = I > + Send + Sync ,
360
360
I : Iterator < Item = & ' id PrimaryKey > + Send + Sync ,
361
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ' id + ?Sized ,
361
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ' id + ?Sized ,
362
362
{
363
363
self . connection . get_multiple :: < Cl , _ , _ , _ > ( ids)
364
364
}
@@ -386,7 +386,7 @@ where
386
386
pub fn list < PrimaryKey , R > ( & ' a self , ids : R ) -> List < ' a , Cn , Cl , PrimaryKey >
387
387
where
388
388
R : Into < Range < & ' a PrimaryKey > > ,
389
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ' a + ?Sized ,
389
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ' a + ?Sized ,
390
390
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
391
391
{
392
392
List :: new ( MaybeOwned :: Borrowed ( self ) , RangeRef :: borrowed ( ids. into ( ) ) )
@@ -417,10 +417,8 @@ where
417
417
prefix : & ' a PrimaryKey ,
418
418
) -> List < ' a , Cn , Cl , PrimaryKey >
419
419
where
420
- PrimaryKey : IntoPrefixRange < ' a , Cl :: PrimaryKey >
421
- + for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey >
422
- + PartialEq
423
- + ?Sized ,
420
+ PrimaryKey :
421
+ IntoPrefixRange < ' a , Cl :: PrimaryKey > + KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
424
422
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
425
423
{
426
424
List :: new ( MaybeOwned :: Borrowed ( self ) , prefix. to_prefix_range ( ) )
@@ -483,7 +481,7 @@ impl<'a, Cn, Cl, PrimaryKey> List<'a, Cn, Cl, PrimaryKey>
483
481
where
484
482
Cl : schema:: Collection ,
485
483
Cn : Connection ,
486
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ' a + ?Sized ,
484
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ' a + ?Sized ,
487
485
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
488
486
{
489
487
pub ( crate ) const fn new (
@@ -673,7 +671,7 @@ where
673
671
V :: Key : Borrow < Key > + PartialEq < Key > ,
674
672
V : schema:: SerializedView ,
675
673
Cn : Connection ,
676
- Key : for < ' k > KeyEncoding < ' k , V :: Key > + PartialEq + ?Sized ,
674
+ Key : KeyEncoding < V :: Key > + PartialEq + ?Sized ,
677
675
{
678
676
const fn new ( connection : & ' a Cn ) -> Self {
679
677
Self {
@@ -703,7 +701,7 @@ where
703
701
#[ allow( clippy:: missing_const_for_fn) ] // false positive, destructors
704
702
pub fn with_key < K > ( self , key : & ' a K ) -> View < ' a , Cn , V , K >
705
703
where
706
- K : for < ' k > KeyEncoding < ' k , V :: Key > + PartialEq + ?Sized ,
704
+ K : KeyEncoding < V :: Key > + PartialEq + ?Sized ,
707
705
V :: Key : Borrow < K > + PartialEq < K > ,
708
706
{
709
707
View {
@@ -800,7 +798,7 @@ where
800
798
/// ```
801
799
pub fn with_key_prefix < K > ( self , prefix : & ' a K ) -> View < ' a , Cn , V , K >
802
800
where
803
- K : for < ' k > KeyEncoding < ' k , V :: Key > + IntoPrefixRange < ' a , V :: Key > + PartialEq + ?Sized ,
801
+ K : KeyEncoding < V :: Key > + IntoPrefixRange < ' a , V :: Key > + PartialEq + ?Sized ,
804
802
V :: Key : Borrow < K > + PartialEq < K > ,
805
803
{
806
804
View {
@@ -1261,7 +1259,7 @@ where
1261
1259
) -> Result < CollectionHeader < Cl :: PrimaryKey > , crate :: Error >
1262
1260
where
1263
1261
Cl : schema:: SerializedCollection ,
1264
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ?Sized ,
1262
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ?Sized ,
1265
1263
{
1266
1264
let contents = Cl :: serialize ( item) ?;
1267
1265
self . connection . insert :: < Cl , _ , _ > ( Some ( id) , contents) . await
@@ -1292,7 +1290,7 @@ where
1292
1290
contents : B ,
1293
1291
) -> Result < CollectionHeader < Cl :: PrimaryKey > , crate :: Error >
1294
1292
where
1295
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ?Sized ,
1293
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ?Sized ,
1296
1294
{
1297
1295
self . connection . insert :: < Cl , _ , B > ( Some ( id) , contents) . await
1298
1296
}
@@ -1365,7 +1363,7 @@ where
1365
1363
/// ```
1366
1364
pub async fn get < PrimaryKey > ( & self , id : & PrimaryKey ) -> Result < Option < OwnedDocument > , Error >
1367
1365
where
1368
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ?Sized ,
1366
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ?Sized ,
1369
1367
{
1370
1368
self . connection . get :: < Cl , _ > ( id) . await
1371
1369
}
@@ -1398,7 +1396,7 @@ where
1398
1396
where
1399
1397
DocumentIds : IntoIterator < Item = & ' id PrimaryKey , IntoIter = I > + Send + Sync ,
1400
1398
I : Iterator < Item = & ' id PrimaryKey > + Send + Sync ,
1401
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + ' id + ?Sized ,
1399
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + ' id + ?Sized ,
1402
1400
{
1403
1401
self . connection . get_multiple :: < Cl , _ , _ , _ > ( ids) . await
1404
1402
}
@@ -1428,7 +1426,7 @@ where
1428
1426
pub fn list < PrimaryKey , R > ( & ' a self , ids : R ) -> AsyncList < ' a , Cn , Cl , PrimaryKey >
1429
1427
where
1430
1428
R : Into < RangeRef < ' a , Cl :: PrimaryKey , PrimaryKey > > ,
1431
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ?Sized ,
1429
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
1432
1430
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
1433
1431
{
1434
1432
AsyncList :: new ( MaybeOwned :: Borrowed ( self ) , ids. into ( ) )
@@ -1457,10 +1455,8 @@ where
1457
1455
prefix : & ' a PrimaryKey ,
1458
1456
) -> AsyncList < ' a , Cn , Cl , PrimaryKey >
1459
1457
where
1460
- PrimaryKey : IntoPrefixRange < ' a , Cl :: PrimaryKey >
1461
- + for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey >
1462
- + PartialEq
1463
- + ?Sized ,
1458
+ PrimaryKey :
1459
+ IntoPrefixRange < ' a , Cl :: PrimaryKey > + KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
1464
1460
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
1465
1461
{
1466
1462
AsyncList :: new ( MaybeOwned :: Borrowed ( self ) , prefix. to_prefix_range ( ) )
@@ -1508,7 +1504,7 @@ where
1508
1504
pub ( crate ) struct AsyncListBuilder < ' a , Cn , Cl , PrimaryKey >
1509
1505
where
1510
1506
Cl : schema:: Collection ,
1511
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ?Sized ,
1507
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
1512
1508
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
1513
1509
{
1514
1510
collection : MaybeOwned < ' a , AsyncCollection < ' a , Cn , Cl > > ,
@@ -1608,7 +1604,7 @@ where
1608
1604
pub ( crate ) enum ListState < ' a , Cn , Cl , PrimaryKey >
1609
1605
where
1610
1606
Cl : schema:: Collection ,
1611
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ?Sized ,
1607
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
1612
1608
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
1613
1609
{
1614
1610
Pending ( Option < AsyncListBuilder < ' a , Cn , Cl , PrimaryKey > > ) ,
@@ -1621,7 +1617,7 @@ where
1621
1617
pub struct AsyncList < ' a , Cn , Cl , PrimaryKey >
1622
1618
where
1623
1619
Cl : schema:: Collection ,
1624
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ?Sized ,
1620
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
1625
1621
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
1626
1622
{
1627
1623
state : ListState < ' a , Cn , Cl , PrimaryKey > ,
@@ -1631,7 +1627,7 @@ impl<'a, Cn, Cl, PrimaryKey> AsyncList<'a, Cn, Cl, PrimaryKey>
1631
1627
where
1632
1628
Cl : schema:: Collection ,
1633
1629
Cn : AsyncConnection ,
1634
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ?Sized ,
1630
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized ,
1635
1631
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > ,
1636
1632
{
1637
1633
pub ( crate ) const fn new (
@@ -1747,7 +1743,7 @@ impl<'a, Cn, Cl, PrimaryKey> Future for AsyncList<'a, Cn, Cl, PrimaryKey>
1747
1743
where
1748
1744
Cn : AsyncConnection ,
1749
1745
Cl : schema:: Collection + Unpin ,
1750
- PrimaryKey : for < ' k > KeyEncoding < ' k , Cl :: PrimaryKey > + PartialEq + ?Sized + Unpin ,
1746
+ PrimaryKey : KeyEncoding < Cl :: PrimaryKey > + PartialEq + ?Sized + Unpin ,
1751
1747
Cl :: PrimaryKey : Borrow < PrimaryKey > + PartialEq < PrimaryKey > + Unpin ,
1752
1748
{
1753
1749
type Output = Result < Vec < OwnedDocument > , Error > ;
@@ -1854,7 +1850,7 @@ impl<'a, Cn, V, Key> AsyncView<'a, Cn, V, Key>
1854
1850
where
1855
1851
V : schema:: SerializedView ,
1856
1852
Cn : AsyncConnection ,
1857
- Key : for < ' k > KeyEncoding < ' k , V :: Key > + PartialEq + ?Sized ,
1853
+ Key : KeyEncoding < V :: Key > + PartialEq + ?Sized ,
1858
1854
V :: Key : Borrow < Key > + PartialEq < Key > ,
1859
1855
{
1860
1856
const fn new ( connection : & ' a Cn ) -> Self {
@@ -1891,7 +1887,7 @@ where
1891
1887
#[ allow( clippy:: missing_const_for_fn) ] // false positive, destructors
1892
1888
pub fn with_key < K > ( self , key : & ' a K ) -> AsyncView < ' a , Cn , V , K >
1893
1889
where
1894
- K : for < ' k > KeyEncoding < ' k , V :: Key > + PartialEq + ?Sized ,
1890
+ K : KeyEncoding < V :: Key > + PartialEq + ?Sized ,
1895
1891
V :: Key : Borrow < K > + PartialEq < K > ,
1896
1892
{
1897
1893
AsyncView {
@@ -1968,7 +1964,7 @@ where
1968
1964
range : R ,
1969
1965
) -> AsyncView < ' a , Cn , V , K >
1970
1966
where
1971
- K : for < ' k > KeyEncoding < ' k , V :: Key > + PartialEq + ?Sized ,
1967
+ K : KeyEncoding < V :: Key > + PartialEq + ?Sized ,
1972
1968
V :: Key : Borrow < K > + PartialEq < K > ,
1973
1969
{
1974
1970
AsyncView {
@@ -2008,7 +2004,7 @@ where
2008
2004
/// ```
2009
2005
pub fn with_key_prefix < K > ( self , prefix : & ' a K ) -> AsyncView < ' a , Cn , V , K >
2010
2006
where
2011
- K : for < ' k > KeyEncoding < ' k , V :: Key > + IntoPrefixRange < ' a , V :: Key > + PartialEq + ?Sized ,
2007
+ K : KeyEncoding < V :: Key > + IntoPrefixRange < ' a , V :: Key > + PartialEq + ?Sized ,
2012
2008
V :: Key : Borrow < K > + PartialEq < K > ,
2013
2009
{
2014
2010
AsyncView {
@@ -2291,7 +2287,7 @@ where
2291
2287
2292
2288
impl < ' a , KOwned , KBorrowed > QueryKey < ' a , KOwned , KBorrowed >
2293
2289
where
2294
- KBorrowed : for < ' k > KeyEncoding < ' k , KOwned > + PartialEq + ?Sized ,
2290
+ KBorrowed : KeyEncoding < KOwned > + PartialEq + ?Sized ,
2295
2291
KOwned : for < ' k > Key < ' k > + Borrow < KBorrowed > + PartialEq < KBorrowed > ,
2296
2292
{
2297
2293
/// Converts this key to a serialized format using the [`Key`] trait.
@@ -2503,7 +2499,7 @@ where
2503
2499
/// Serializes the range's contained values to big-endian bytes.
2504
2500
pub fn as_ord_bytes ( & ' a self ) -> Result < Range < Bytes > , TBorrowed :: Error >
2505
2501
where
2506
- TBorrowed : KeyEncoding < ' a , TOwned > ,
2502
+ TBorrowed : KeyEncoding < TOwned > ,
2507
2503
TOwned : for < ' k > Key < ' k > + Borrow < TBorrowed > ,
2508
2504
{
2509
2505
Ok ( Range {
@@ -2517,7 +2513,7 @@ impl Range<Bytes> {
2517
2513
/// Deserializes the range's contained values from big-endian bytes.
2518
2514
pub fn deserialize < T : for < ' k > Key < ' k > > (
2519
2515
& self ,
2520
- ) -> Result < Range < T > , <T as KeyEncoding < ' _ , T > >:: Error > {
2516
+ ) -> Result < Range < T > , <T as KeyEncoding < T > >:: Error > {
2521
2517
Ok ( Range {
2522
2518
start : self . start . deserialize ( ) ?,
2523
2519
end : self . start . deserialize ( ) ?,
@@ -2563,7 +2559,7 @@ where
2563
2559
/// Serializes the contained value to big-endian bytes.
2564
2560
pub fn as_ord_bytes ( & ' a self ) -> Result < Bound < Bytes > , TBorrowed :: Error >
2565
2561
where
2566
- TBorrowed : KeyEncoding < ' a , TOwned > ,
2562
+ TBorrowed : KeyEncoding < TOwned > ,
2567
2563
TOwned : for < ' k > Key < ' k > + Borrow < TBorrowed > ,
2568
2564
{
2569
2565
match self {
@@ -2582,7 +2578,7 @@ impl Bound<Bytes> {
2582
2578
/// Deserializes the bound's contained value from big-endian bytes.
2583
2579
pub fn deserialize < T : for < ' k > Key < ' k > > (
2584
2580
& self ,
2585
- ) -> Result < Bound < T > , <T as KeyEncoding < ' _ , T > >:: Error > {
2581
+ ) -> Result < Bound < T > , <T as KeyEncoding < T > >:: Error > {
2586
2582
match self {
2587
2583
Self :: Unbounded => Ok ( Bound :: Unbounded ) ,
2588
2584
Self :: Included ( value) => Ok ( Bound :: Included ( T :: from_ord_bytes ( ByteSource :: Borrowed (
@@ -3397,7 +3393,7 @@ impl<'k> Key<'k> for SensitiveString {
3397
3393
}
3398
3394
}
3399
3395
3400
- impl < ' k > KeyEncoding < ' k , Self > for SensitiveString {
3396
+ impl KeyEncoding < Self > for SensitiveString {
3401
3397
type Error = FromUtf8Error ;
3402
3398
3403
3399
const LENGTH : Option < usize > = None ;
@@ -3409,7 +3405,7 @@ impl<'k> KeyEncoding<'k, Self> for SensitiveString {
3409
3405
visitor. visit_type ( KeyKind :: String ) ;
3410
3406
}
3411
3407
3412
- fn as_ord_bytes ( & ' k self ) -> Result < std:: borrow:: Cow < ' k , [ u8 ] > , Self :: Error > {
3408
+ fn as_ord_bytes ( & self ) -> Result < std:: borrow:: Cow < ' _ , [ u8 ] > , Self :: Error > {
3413
3409
self . 0 . as_ord_bytes ( )
3414
3410
}
3415
3411
}
@@ -3461,7 +3457,7 @@ impl<'k> Key<'k> for SensitiveBytes {
3461
3457
}
3462
3458
}
3463
3459
3464
- impl < ' k > KeyEncoding < ' k , Self > for SensitiveBytes {
3460
+ impl KeyEncoding < Self > for SensitiveBytes {
3465
3461
type Error = Infallible ;
3466
3462
3467
3463
const LENGTH : Option < usize > = None ;
@@ -3473,7 +3469,7 @@ impl<'k> KeyEncoding<'k, Self> for SensitiveBytes {
3473
3469
visitor. visit_type ( KeyKind :: Bytes ) ;
3474
3470
}
3475
3471
3476
- fn as_ord_bytes ( & ' k self ) -> Result < std:: borrow:: Cow < ' k , [ u8 ] > , Self :: Error > {
3472
+ fn as_ord_bytes ( & self ) -> Result < std:: borrow:: Cow < ' _ , [ u8 ] > , Self :: Error > {
3477
3473
self . 0 . as_ord_bytes ( )
3478
3474
}
3479
3475
}
0 commit comments