@@ -53,29 +53,29 @@ use crate::*;
53
53
/// # Ok(()) }
54
54
/// ```
55
55
#[ derive( Debug ) ]
56
- pub struct EncryptedDatabaseOpenOptions < ' e , ' n , KC , DC , C = DefaultComparator > {
57
- inner : DatabaseOpenOptions < ' e , ' n , KC , DC , C > ,
56
+ pub struct EncryptedDatabaseOpenOptions < ' e , ' n , T , KC , DC , C = DefaultComparator > {
57
+ inner : DatabaseOpenOptions < ' e , ' n , T , KC , DC , C > ,
58
58
}
59
59
60
- impl < ' e > EncryptedDatabaseOpenOptions < ' e , ' static , Unspecified , Unspecified > {
60
+ impl < ' e , T > EncryptedDatabaseOpenOptions < ' e , ' static , T , Unspecified , Unspecified > {
61
61
/// Create an options struct to open/create a database with specific flags.
62
- pub fn new ( env : & ' e EncryptedEnv ) -> Self {
62
+ pub fn new ( env : & ' e EncryptedEnv < T > ) -> Self {
63
63
EncryptedDatabaseOpenOptions { inner : DatabaseOpenOptions :: new ( & env. inner ) }
64
64
}
65
65
}
66
66
67
- impl < ' e , ' n , KC , DC , C > EncryptedDatabaseOpenOptions < ' e , ' n , KC , DC , C > {
67
+ impl < ' e , ' n , T , KC , DC , C > EncryptedDatabaseOpenOptions < ' e , ' n , T , KC , DC , C > {
68
68
/// Change the type of the database.
69
69
///
70
70
/// The default types are [`Unspecified`] and require a call to [`Database::remap_types`]
71
71
/// to use the [`Database`].
72
- pub fn types < NKC , NDC > ( self ) -> EncryptedDatabaseOpenOptions < ' e , ' n , NKC , NDC > {
72
+ pub fn types < NKC , NDC > ( self ) -> EncryptedDatabaseOpenOptions < ' e , ' n , T , NKC , NDC > {
73
73
EncryptedDatabaseOpenOptions { inner : self . inner . types ( ) }
74
74
}
75
75
/// Change the customized key compare function of the database.
76
76
///
77
77
/// By default no customized compare function will be set when opening a database.
78
- pub fn key_comparator < NC > ( self ) -> EncryptedDatabaseOpenOptions < ' e , ' n , KC , DC , NC > {
78
+ pub fn key_comparator < NC > ( self ) -> EncryptedDatabaseOpenOptions < ' e , ' n , T , KC , DC , NC > {
79
79
EncryptedDatabaseOpenOptions { inner : self . inner . key_comparator ( ) }
80
80
}
81
81
@@ -111,7 +111,7 @@ impl<'e, 'n, KC, DC, C> EncryptedDatabaseOpenOptions<'e, 'n, KC, DC, C> {
111
111
///
112
112
/// If not done, you might raise `Io(Os { code: 22, kind: InvalidInput, message: "Invalid argument" })`
113
113
/// known as `EINVAL`.
114
- pub fn open ( & self , rtxn : & RoTxn ) -> Result < Option < EncryptedDatabase < KC , DC , C > > >
114
+ pub fn open ( & self , rtxn : & RoTxn < T > ) -> Result < Option < EncryptedDatabase < KC , DC , C > > >
115
115
where
116
116
KC : ' static ,
117
117
DC : ' static ,
@@ -139,13 +139,13 @@ impl<'e, 'n, KC, DC, C> EncryptedDatabaseOpenOptions<'e, 'n, KC, DC, C> {
139
139
}
140
140
}
141
141
142
- impl < KC , DC , C > Clone for EncryptedDatabaseOpenOptions < ' _ , ' _ , KC , DC , C > {
142
+ impl < T , KC , DC , C > Clone for EncryptedDatabaseOpenOptions < ' _ , ' _ , T , KC , DC , C > {
143
143
fn clone ( & self ) -> Self {
144
144
* self
145
145
}
146
146
}
147
147
148
- impl < KC , DC , C > Copy for EncryptedDatabaseOpenOptions < ' _ , ' _ , KC , DC , C > { }
148
+ impl < T , KC , DC , C > Copy for EncryptedDatabaseOpenOptions < ' _ , ' _ , T , KC , DC , C > { }
149
149
150
150
/// A typed database that accepts only the types it was created with.
151
151
///
@@ -305,9 +305,9 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
305
305
/// wtxn.commit()?;
306
306
/// # Ok(()) }
307
307
/// ```
308
- pub fn get < ' a , ' txn > (
308
+ pub fn get < ' a , ' txn , T > (
309
309
& self ,
310
- txn : & ' txn mut RoTxn ,
310
+ txn : & ' txn mut RoTxn < T > ,
311
311
key : & ' a KC :: EItem ,
312
312
) -> Result < Option < DC :: DItem > >
313
313
where
@@ -369,11 +369,11 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
369
369
/// wtxn.commit()?;
370
370
/// # Ok(()) }
371
371
/// ```
372
- pub fn get_duplicates < ' a , ' txn > (
372
+ pub fn get_duplicates < ' a , ' txn , T > (
373
373
& self ,
374
- txn : & ' txn mut RoTxn ,
374
+ txn : & ' txn mut RoTxn < T > ,
375
375
key : & ' a KC :: EItem ,
376
- ) -> Result < Option < RoIter < ' txn , KC , DC , MoveOnCurrentKeyDuplicates > > >
376
+ ) -> Result < Option < RoIter < ' txn , T , KC , DC , MoveOnCurrentKeyDuplicates > > >
377
377
where
378
378
KC : BytesEncode < ' a > ,
379
379
{
@@ -424,9 +424,9 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
424
424
/// wtxn.commit()?;
425
425
/// # Ok(()) }
426
426
/// ```
427
- pub fn get_lower_than < ' a , ' txn > (
427
+ pub fn get_lower_than < ' a , ' txn , T > (
428
428
& self ,
429
- txn : & ' txn mut RoTxn ,
429
+ txn : & ' txn mut RoTxn < T > ,
430
430
key : & ' a KC :: EItem ,
431
431
) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
432
432
where
@@ -480,9 +480,9 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
480
480
/// wtxn.commit()?;
481
481
/// # Ok(()) }
482
482
/// ```
483
- pub fn get_lower_than_or_equal_to < ' a , ' txn > (
483
+ pub fn get_lower_than_or_equal_to < ' a , ' txn , T > (
484
484
& self ,
485
- txn : & ' txn mut RoTxn ,
485
+ txn : & ' txn mut RoTxn < T > ,
486
486
key : & ' a KC :: EItem ,
487
487
) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
488
488
where
@@ -536,9 +536,9 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
536
536
/// wtxn.commit()?;
537
537
/// # Ok(()) }
538
538
/// ```
539
- pub fn get_greater_than < ' a , ' txn > (
539
+ pub fn get_greater_than < ' a , ' txn , T > (
540
540
& self ,
541
- txn : & ' txn mut RoTxn ,
541
+ txn : & ' txn mut RoTxn < T > ,
542
542
key : & ' a KC :: EItem ,
543
543
) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
544
544
where
@@ -592,9 +592,9 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
592
592
/// wtxn.commit()?;
593
593
/// # Ok(()) }
594
594
/// ```
595
- pub fn get_greater_than_or_equal_to < ' a , ' txn > (
595
+ pub fn get_greater_than_or_equal_to < ' a , ' txn , T > (
596
596
& self ,
597
- txn : & ' txn mut RoTxn ,
597
+ txn : & ' txn mut RoTxn < T > ,
598
598
key : & ' a KC :: EItem ,
599
599
) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
600
600
where
@@ -640,7 +640,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
640
640
/// wtxn.commit()?;
641
641
/// # Ok(()) }
642
642
/// ```
643
- pub fn first < ' txn > ( & self , txn : & ' txn mut RoTxn ) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
643
+ pub fn first < ' txn , T > ( & self , txn : & ' txn mut RoTxn < T > ) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
644
644
where
645
645
KC : BytesDecode < ' txn > ,
646
646
DC : BytesDecode < ' txn > ,
@@ -684,7 +684,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
684
684
/// wtxn.commit()?;
685
685
/// # Ok(()) }
686
686
/// ```
687
- pub fn last < ' txn > ( & self , txn : & ' txn mut RoTxn ) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
687
+ pub fn last < ' txn , T > ( & self , txn : & ' txn mut RoTxn < T > ) -> Result < Option < ( KC :: DItem , DC :: DItem ) > >
688
688
where
689
689
KC : BytesDecode < ' txn > ,
690
690
DC : BytesDecode < ' txn > ,
@@ -731,7 +731,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
731
731
/// wtxn.commit()?;
732
732
/// # Ok(()) }
733
733
/// ```
734
- pub fn len ( & self , txn : & RoTxn ) -> Result < u64 > {
734
+ pub fn len < T > ( & self , txn : & RoTxn < T > ) -> Result < u64 > {
735
735
self . inner . len ( txn)
736
736
}
737
737
@@ -774,7 +774,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
774
774
/// wtxn.commit()?;
775
775
/// # Ok(()) }
776
776
/// ```
777
- pub fn is_empty ( & self , txn : & RoTxn ) -> Result < bool > {
777
+ pub fn is_empty < T > ( & self , txn : & RoTxn < T > ) -> Result < bool > {
778
778
self . inner . is_empty ( txn)
779
779
}
780
780
@@ -816,7 +816,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
816
816
/// wtxn.commit()?;
817
817
/// # Ok(()) }
818
818
/// ```
819
- pub fn stat ( & self , txn : & RoTxn ) -> Result < DatabaseStat > {
819
+ pub fn stat < T > ( & self , txn : & RoTxn < T > ) -> Result < DatabaseStat > {
820
820
self . inner . stat ( txn)
821
821
}
822
822
@@ -860,7 +860,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
860
860
/// wtxn.commit()?;
861
861
/// # Ok(()) }
862
862
/// ```
863
- pub fn iter < ' txn > ( & self , txn : & ' txn mut RoTxn ) -> Result < RoIter < ' txn , KC , DC > > {
863
+ pub fn iter < ' txn , T > ( & self , txn : & ' txn mut RoTxn < T > ) -> Result < RoIter < ' txn , T , KC , DC > > {
864
864
self . inner . iter ( txn)
865
865
}
866
866
@@ -914,7 +914,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
914
914
/// wtxn.commit()?;
915
915
/// # Ok(()) }
916
916
/// ```
917
- pub fn iter_mut < ' txn > ( & self , txn : & ' txn mut RwTxn ) -> Result < RwIter < ' txn , KC , DC > > {
917
+ pub fn iter_mut < ' txn , T > ( & self , txn : & ' txn mut RwTxn ) -> Result < RwIter < ' txn , KC , DC > > {
918
918
self . inner . iter_mut ( txn)
919
919
}
920
920
@@ -958,7 +958,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
958
958
/// wtxn.commit()?;
959
959
/// # Ok(()) }
960
960
/// ```
961
- pub fn rev_iter < ' txn > ( & self , txn : & ' txn mut RoTxn ) -> Result < RoRevIter < ' txn , KC , DC > > {
961
+ pub fn rev_iter < ' txn , T > ( & self , txn : & ' txn mut RoTxn < T > ) -> Result < RoRevIter < ' txn , T , KC , DC > > {
962
962
self . inner . rev_iter ( txn)
963
963
}
964
964
@@ -1013,7 +1013,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1013
1013
/// wtxn.commit()?;
1014
1014
/// # Ok(()) }
1015
1015
/// ```
1016
- pub fn rev_iter_mut < ' txn > ( & self , txn : & ' txn mut RwTxn ) -> Result < RwRevIter < ' txn , KC , DC > > {
1016
+ pub fn rev_iter_mut < ' txn , T > ( & self , txn : & ' txn mut RwTxn ) -> Result < RwRevIter < ' txn , KC , DC > > {
1017
1017
self . inner . rev_iter_mut ( txn)
1018
1018
}
1019
1019
@@ -1060,11 +1060,11 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1060
1060
/// wtxn.commit()?;
1061
1061
/// # Ok(()) }
1062
1062
/// ```
1063
- pub fn range < ' a , ' txn , R > (
1063
+ pub fn range < ' a , ' txn , R , T > (
1064
1064
& self ,
1065
- txn : & ' txn mut RoTxn ,
1065
+ txn : & ' txn mut RoTxn < T > ,
1066
1066
range : & ' a R ,
1067
- ) -> Result < RoRange < ' txn , KC , DC , C > >
1067
+ ) -> Result < RoRange < ' txn , T , KC , DC , C > >
1068
1068
where
1069
1069
KC : BytesEncode < ' a > ,
1070
1070
R : RangeBounds < KC :: EItem > ,
@@ -1182,11 +1182,11 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1182
1182
/// wtxn.commit()?;
1183
1183
/// # Ok(()) }
1184
1184
/// ```
1185
- pub fn rev_range < ' a , ' txn , R > (
1185
+ pub fn rev_range < ' a , ' txn , R , T > (
1186
1186
& self ,
1187
- txn : & ' txn mut RoTxn ,
1187
+ txn : & ' txn mut RoTxn < T > ,
1188
1188
range : & ' a R ,
1189
- ) -> Result < RoRevRange < ' txn , KC , DC , C > >
1189
+ ) -> Result < RoRevRange < ' txn , T , KC , DC , C > >
1190
1190
where
1191
1191
KC : BytesEncode < ' a > ,
1192
1192
R : RangeBounds < KC :: EItem > ,
@@ -1305,11 +1305,11 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1305
1305
/// wtxn.commit()?;
1306
1306
/// # Ok(()) }
1307
1307
/// ```
1308
- pub fn prefix_iter < ' a , ' txn > (
1308
+ pub fn prefix_iter < ' a , ' txn , T > (
1309
1309
& self ,
1310
- txn : & ' txn mut RoTxn ,
1310
+ txn : & ' txn mut RoTxn < T > ,
1311
1311
prefix : & ' a KC :: EItem ,
1312
- ) -> Result < RoPrefix < ' txn , KC , DC , C > >
1312
+ ) -> Result < RoPrefix < ' txn , T , KC , DC , C > >
1313
1313
where
1314
1314
KC : BytesEncode < ' a > ,
1315
1315
C : LexicographicComparator ,
@@ -1372,7 +1372,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1372
1372
/// wtxn.commit()?;
1373
1373
/// # Ok(()) }
1374
1374
/// ```
1375
- pub fn prefix_iter_mut < ' a , ' txn > (
1375
+ pub fn prefix_iter_mut < ' a , ' txn , T > (
1376
1376
& self ,
1377
1377
txn : & ' txn mut RwTxn ,
1378
1378
prefix : & ' a KC :: EItem ,
@@ -1429,11 +1429,11 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1429
1429
/// wtxn.commit()?;
1430
1430
/// # Ok(()) }
1431
1431
/// ```
1432
- pub fn rev_prefix_iter < ' a , ' txn > (
1432
+ pub fn rev_prefix_iter < ' a , ' txn , T > (
1433
1433
& self ,
1434
- txn : & ' txn mut RoTxn ,
1434
+ txn : & ' txn mut RoTxn < T > ,
1435
1435
prefix : & ' a KC :: EItem ,
1436
- ) -> Result < RoRevPrefix < ' txn , KC , DC , C > >
1436
+ ) -> Result < RoRevPrefix < ' txn , T , KC , DC , C > >
1437
1437
where
1438
1438
KC : BytesEncode < ' a > ,
1439
1439
C : LexicographicComparator ,
@@ -1496,7 +1496,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1496
1496
/// wtxn.commit()?;
1497
1497
/// # Ok(()) }
1498
1498
/// ```
1499
- pub fn rev_prefix_iter_mut < ' a , ' txn > (
1499
+ pub fn rev_prefix_iter_mut < ' a , ' txn , T > (
1500
1500
& self ,
1501
1501
txn : & ' txn mut RwTxn ,
1502
1502
prefix : & ' a KC :: EItem ,
@@ -1707,7 +1707,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1707
1707
/// wtxn.commit()?;
1708
1708
/// # Ok(()) }
1709
1709
/// ```
1710
- pub fn get_or_put < ' a , ' txn > (
1710
+ pub fn get_or_put < ' a , ' txn , T > (
1711
1711
& ' txn self ,
1712
1712
txn : & mut RwTxn ,
1713
1713
key : & ' a KC :: EItem ,
@@ -1754,7 +1754,7 @@ impl<KC, DC, C> EncryptedDatabase<KC, DC, C> {
1754
1754
/// wtxn.commit()?;
1755
1755
/// # Ok(()) }
1756
1756
/// ```
1757
- pub fn get_or_put_with_flags < ' a , ' txn > (
1757
+ pub fn get_or_put_with_flags < ' a , ' txn , T > (
1758
1758
& ' txn self ,
1759
1759
txn : & mut RwTxn ,
1760
1760
flags : PutFlags ,
0 commit comments