@@ -158,7 +158,7 @@ impl PolyDatabase {
158
158
KC : BytesEncode < ' a > ,
159
159
DC : BytesDecode < ' txn > ,
160
160
{
161
- assert_matching_env_txn ! ( self , txn) ;
161
+ assert_eq_env_db_txn ! ( self , txn) ;
162
162
163
163
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
164
164
@@ -232,7 +232,7 @@ impl PolyDatabase {
232
232
KC : BytesEncode < ' a > + BytesDecode < ' txn > ,
233
233
DC : BytesDecode < ' txn > ,
234
234
{
235
- assert_matching_env_txn ! ( self , txn) ;
235
+ assert_eq_env_db_txn ! ( self , txn) ;
236
236
237
237
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
238
238
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
@@ -300,7 +300,7 @@ impl PolyDatabase {
300
300
KC : BytesEncode < ' a > + BytesDecode < ' txn > ,
301
301
DC : BytesDecode < ' txn > ,
302
302
{
303
- assert_matching_env_txn ! ( self , txn) ;
303
+ assert_eq_env_db_txn ! ( self , txn) ;
304
304
305
305
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
306
306
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
@@ -372,7 +372,7 @@ impl PolyDatabase {
372
372
KC : BytesEncode < ' a > + BytesDecode < ' txn > ,
373
373
DC : BytesDecode < ' txn > ,
374
374
{
375
- assert_matching_env_txn ! ( self , txn) ;
375
+ assert_eq_env_db_txn ! ( self , txn) ;
376
376
377
377
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
378
378
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
@@ -443,7 +443,7 @@ impl PolyDatabase {
443
443
KC : BytesEncode < ' a > + BytesDecode < ' txn > ,
444
444
DC : BytesDecode < ' txn > ,
445
445
{
446
- assert_matching_env_txn ! ( self , txn) ;
446
+ assert_eq_env_db_txn ! ( self , txn) ;
447
447
448
448
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
449
449
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
@@ -497,7 +497,7 @@ impl PolyDatabase {
497
497
KC : BytesDecode < ' txn > ,
498
498
DC : BytesDecode < ' txn > ,
499
499
{
500
- assert_matching_env_txn ! ( self , txn) ;
500
+ assert_eq_env_db_txn ! ( self , txn) ;
501
501
502
502
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
503
503
match cursor. move_on_first ( ) {
@@ -550,7 +550,7 @@ impl PolyDatabase {
550
550
KC : BytesDecode < ' txn > ,
551
551
DC : BytesDecode < ' txn > ,
552
552
{
553
- assert_matching_env_txn ! ( self , txn) ;
553
+ assert_eq_env_db_txn ! ( self , txn) ;
554
554
555
555
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
556
556
match cursor. move_on_last ( ) {
@@ -603,7 +603,7 @@ impl PolyDatabase {
603
603
/// # Ok(()) }
604
604
/// ```
605
605
pub fn len < ' txn > ( & self , txn : & ' txn RoTxn ) -> Result < u64 > {
606
- assert_matching_env_txn ! ( self , txn) ;
606
+ assert_eq_env_db_txn ! ( self , txn) ;
607
607
608
608
let mut db_stat = mem:: MaybeUninit :: uninit ( ) ;
609
609
let result = unsafe { mdb_result ( ffi:: mdb_stat ( txn. txn , self . dbi , db_stat. as_mut_ptr ( ) ) ) } ;
@@ -656,7 +656,7 @@ impl PolyDatabase {
656
656
/// # Ok(()) }
657
657
/// ```
658
658
pub fn is_empty < ' txn > ( & self , txn : & ' txn RoTxn ) -> Result < bool > {
659
- assert_matching_env_txn ! ( self , txn) ;
659
+ assert_eq_env_db_txn ! ( self , txn) ;
660
660
661
661
let mut cursor = RoCursor :: new ( txn, self . dbi ) ?;
662
662
match cursor. move_on_first ( ) ? {
@@ -702,7 +702,7 @@ impl PolyDatabase {
702
702
/// # Ok(()) }
703
703
/// ```
704
704
pub fn iter < ' txn , KC , DC > ( & self , txn : & ' txn RoTxn ) -> Result < RoIter < ' txn , KC , DC > > {
705
- assert_matching_env_txn ! ( self , txn) ;
705
+ assert_eq_env_db_txn ! ( self , txn) ;
706
706
707
707
RoCursor :: new ( txn, self . dbi ) . map ( |cursor| RoIter :: new ( cursor) )
708
708
}
@@ -757,7 +757,7 @@ impl PolyDatabase {
757
757
/// # Ok(()) }
758
758
/// ```
759
759
pub fn iter_mut < ' txn , KC , DC > ( & self , txn : & ' txn mut RwTxn ) -> Result < RwIter < ' txn , KC , DC > > {
760
- assert_matching_env_txn ! ( self , txn) ;
760
+ assert_eq_env_db_txn ! ( self , txn) ;
761
761
762
762
RwCursor :: new ( txn, self . dbi ) . map ( |cursor| RwIter :: new ( cursor) )
763
763
}
@@ -799,7 +799,7 @@ impl PolyDatabase {
799
799
/// # Ok(()) }
800
800
/// ```
801
801
pub fn rev_iter < ' txn , KC , DC > ( & self , txn : & ' txn RoTxn ) -> Result < RoRevIter < ' txn , KC , DC > > {
802
- assert_matching_env_txn ! ( self , txn) ;
802
+ assert_eq_env_db_txn ! ( self , txn) ;
803
803
804
804
RoCursor :: new ( txn, self . dbi ) . map ( |cursor| RoRevIter :: new ( cursor) )
805
805
}
@@ -858,7 +858,7 @@ impl PolyDatabase {
858
858
& self ,
859
859
txn : & ' txn mut RwTxn ,
860
860
) -> Result < RwRevIter < ' txn , KC , DC > > {
861
- assert_matching_env_txn ! ( self , txn) ;
861
+ assert_eq_env_db_txn ! ( self , txn) ;
862
862
863
863
RwCursor :: new ( txn, self . dbi ) . map ( |cursor| RwRevIter :: new ( cursor) )
864
864
}
@@ -911,7 +911,7 @@ impl PolyDatabase {
911
911
KC : BytesEncode < ' a > ,
912
912
R : RangeBounds < KC :: EItem > ,
913
913
{
914
- assert_matching_env_txn ! ( self , txn) ;
914
+ assert_eq_env_db_txn ! ( self , txn) ;
915
915
916
916
let start_bound = match range. start_bound ( ) {
917
917
Bound :: Included ( bound) => {
@@ -1002,7 +1002,7 @@ impl PolyDatabase {
1002
1002
KC : BytesEncode < ' a > ,
1003
1003
R : RangeBounds < KC :: EItem > ,
1004
1004
{
1005
- assert_matching_env_txn ! ( self , txn) ;
1005
+ assert_eq_env_db_txn ! ( self , txn) ;
1006
1006
1007
1007
let start_bound = match range. start_bound ( ) {
1008
1008
Bound :: Included ( bound) => {
@@ -1080,7 +1080,7 @@ impl PolyDatabase {
1080
1080
KC : BytesEncode < ' a > ,
1081
1081
R : RangeBounds < KC :: EItem > ,
1082
1082
{
1083
- assert_matching_env_txn ! ( self , txn) ;
1083
+ assert_eq_env_db_txn ! ( self , txn) ;
1084
1084
1085
1085
let start_bound = match range. start_bound ( ) {
1086
1086
Bound :: Included ( bound) => {
@@ -1171,7 +1171,7 @@ impl PolyDatabase {
1171
1171
KC : BytesEncode < ' a > ,
1172
1172
R : RangeBounds < KC :: EItem > ,
1173
1173
{
1174
- assert_matching_env_txn ! ( self , txn) ;
1174
+ assert_eq_env_db_txn ! ( self , txn) ;
1175
1175
1176
1176
let start_bound = match range. start_bound ( ) {
1177
1177
Bound :: Included ( bound) => {
@@ -1249,7 +1249,7 @@ impl PolyDatabase {
1249
1249
where
1250
1250
KC : BytesEncode < ' a > ,
1251
1251
{
1252
- assert_matching_env_txn ! ( self , txn) ;
1252
+ assert_eq_env_db_txn ! ( self , txn) ;
1253
1253
1254
1254
let prefix_bytes = KC :: bytes_encode ( prefix) . map_err ( Error :: Encoding ) ?;
1255
1255
let prefix_bytes = prefix_bytes. into_owned ( ) ;
@@ -1318,7 +1318,7 @@ impl PolyDatabase {
1318
1318
where
1319
1319
KC : BytesEncode < ' a > ,
1320
1320
{
1321
- assert_matching_env_txn ! ( self , txn) ;
1321
+ assert_eq_env_db_txn ! ( self , txn) ;
1322
1322
1323
1323
let prefix_bytes = KC :: bytes_encode ( prefix) . map_err ( Error :: Encoding ) ?;
1324
1324
let prefix_bytes = prefix_bytes. into_owned ( ) ;
@@ -1374,7 +1374,7 @@ impl PolyDatabase {
1374
1374
where
1375
1375
KC : BytesEncode < ' a > ,
1376
1376
{
1377
- assert_matching_env_txn ! ( self , txn) ;
1377
+ assert_eq_env_db_txn ! ( self , txn) ;
1378
1378
1379
1379
let prefix_bytes = KC :: bytes_encode ( prefix) . map_err ( Error :: Encoding ) ?;
1380
1380
let prefix_bytes = prefix_bytes. into_owned ( ) ;
@@ -1443,7 +1443,7 @@ impl PolyDatabase {
1443
1443
where
1444
1444
KC : BytesEncode < ' a > ,
1445
1445
{
1446
- assert_matching_env_txn ! ( self , txn) ;
1446
+ assert_eq_env_db_txn ! ( self , txn) ;
1447
1447
1448
1448
let prefix_bytes = KC :: bytes_encode ( prefix) . map_err ( Error :: Encoding ) ?;
1449
1449
let prefix_bytes = prefix_bytes. into_owned ( ) ;
@@ -1493,7 +1493,7 @@ impl PolyDatabase {
1493
1493
KC : BytesEncode < ' a > ,
1494
1494
DC : BytesEncode < ' a > ,
1495
1495
{
1496
- assert_matching_env_txn ! ( self , txn) ;
1496
+ assert_eq_env_db_txn ! ( self , txn) ;
1497
1497
1498
1498
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
1499
1499
let data_bytes: Cow < [ u8 ] > = DC :: bytes_encode ( & data) . map_err ( Error :: Encoding ) ?;
@@ -1554,7 +1554,7 @@ impl PolyDatabase {
1554
1554
KC : BytesEncode < ' a > ,
1555
1555
F : FnMut ( & mut ReservedSpace ) -> io:: Result < ( ) > ,
1556
1556
{
1557
- assert_matching_env_txn ! ( self , txn) ;
1557
+ assert_eq_env_db_txn ! ( self , txn) ;
1558
1558
1559
1559
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
1560
1560
let mut key_val = unsafe { crate :: into_val ( & key_bytes) } ;
@@ -1620,7 +1620,7 @@ impl PolyDatabase {
1620
1620
KC : BytesEncode < ' a > ,
1621
1621
DC : BytesEncode < ' a > ,
1622
1622
{
1623
- assert_matching_env_txn ! ( self , txn) ;
1623
+ assert_eq_env_db_txn ! ( self , txn) ;
1624
1624
1625
1625
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
1626
1626
let data_bytes: Cow < [ u8 ] > = DC :: bytes_encode ( & data) . map_err ( Error :: Encoding ) ?;
@@ -1681,7 +1681,7 @@ impl PolyDatabase {
1681
1681
where
1682
1682
KC : BytesEncode < ' a > ,
1683
1683
{
1684
- assert_matching_env_txn ! ( self , txn) ;
1684
+ assert_eq_env_db_txn ! ( self , txn) ;
1685
1685
1686
1686
let key_bytes: Cow < [ u8 ] > = KC :: bytes_encode ( & key) . map_err ( Error :: Encoding ) ?;
1687
1687
let mut key_val = unsafe { crate :: into_val ( & key_bytes) } ;
@@ -1749,7 +1749,7 @@ impl PolyDatabase {
1749
1749
KC : BytesEncode < ' a > + BytesDecode < ' txn > ,
1750
1750
R : RangeBounds < KC :: EItem > ,
1751
1751
{
1752
- assert_matching_env_txn ! ( self , txn) ;
1752
+ assert_eq_env_db_txn ! ( self , txn) ;
1753
1753
1754
1754
let mut count = 0 ;
1755
1755
let mut iter = self . range_mut :: < KC , DecodeIgnore , _ > ( txn, range) ?;
@@ -1806,7 +1806,7 @@ impl PolyDatabase {
1806
1806
/// # Ok(()) }
1807
1807
/// ```
1808
1808
pub fn clear ( & self , txn : & mut RwTxn ) -> Result < ( ) > {
1809
- assert_matching_env_txn ! ( self , txn) ;
1809
+ assert_eq_env_db_txn ! ( self , txn) ;
1810
1810
1811
1811
unsafe { mdb_result ( ffi:: mdb_drop ( txn. txn . txn , self . dbi , 0 ) ) . map_err ( Into :: into) }
1812
1812
}
0 commit comments