From 401953c000fbaa38e7ac82f50f247ac679e58ac7 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 5 Mar 2025 14:34:27 +0100 Subject: [PATCH] Prefer implementing Send on the RoCursor --- heed/src/cursor.rs | 3 +++ heed/src/iterator/iter.rs | 6 ------ heed/src/iterator/prefix.rs | 6 ------ heed/src/iterator/range.rs | 6 ------ 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/heed/src/cursor.rs b/heed/src/cursor.rs index 9f4fd0a1..8b97dd1f 100644 --- a/heed/src/cursor.rs +++ b/heed/src/cursor.rs @@ -243,6 +243,9 @@ impl Drop for RoCursor<'_, T> { } } +// Only implement Send if the transaction is Send (WithoutTls) +unsafe impl Send for RoCursor<'_, WithoutTls> {} + pub struct RwCursor<'txn> { cursor: RoCursor<'txn, WithoutTls>, } diff --git a/heed/src/iterator/iter.rs b/heed/src/iterator/iter.rs index 4f7d5c07..45217923 100644 --- a/heed/src/iterator/iter.rs +++ b/heed/src/iterator/iter.rs @@ -210,9 +210,6 @@ impl fmt::Debug for RoIter<'_, KC, DC, IM> { } } -// Only implement Send if the transaction is Send (WithoutTls) -unsafe impl Send for RoIter<'_, WithoutTls, KC, DC, IM> {} - /// A read-write iterator structure. pub struct RwIter<'txn, KC, DC, IM = MoveThroughDuplicateValues> { cursor: RwCursor<'txn>, @@ -559,9 +556,6 @@ impl fmt::Debug for RoRevIter<'_, KC, DC, IM> { } } -// Only implement Send if the transaction is Send (WithoutTls) -unsafe impl Send for RoRevIter<'_, WithoutTls, KC, DC, IM> {} - /// A reverse read-write iterator structure. pub struct RwRevIter<'txn, KC, DC, IM = MoveThroughDuplicateValues> { cursor: RwCursor<'txn>, diff --git a/heed/src/iterator/prefix.rs b/heed/src/iterator/prefix.rs index 61b69af0..70f7f305 100644 --- a/heed/src/iterator/prefix.rs +++ b/heed/src/iterator/prefix.rs @@ -203,9 +203,6 @@ impl fmt::Debug for RoPrefix<'_, KC, DC, C, IM> { } } -// Only implement Send if the transaction is Send (WithoutTls) -unsafe impl Send for RoPrefix<'_, WithoutTls, KC, DC, IM> {} - /// A read-write prefix iterator structure. pub struct RwPrefix<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> { cursor: RwCursor<'txn>, @@ -596,9 +593,6 @@ impl fmt::Debug for RoRevPrefix<'_, T, KC, DC, C, IM> { } } -// Only implement Send if the transaction is Send (WithoutTls) -unsafe impl Send for RoRevPrefix<'_, WithoutTls, KC, DC, IM> {} - /// A reverse read-write prefix iterator structure. pub struct RwRevPrefix<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> { cursor: RwCursor<'txn>, diff --git a/heed/src/iterator/range.rs b/heed/src/iterator/range.rs index dcc5bee5..616e9af9 100644 --- a/heed/src/iterator/range.rs +++ b/heed/src/iterator/range.rs @@ -199,9 +199,6 @@ impl fmt::Debug for RoRange<'_, KC, DC, C, IM> { } } -// Only implement Send if the transaction is Send (WithoutTls) -unsafe impl Send for RoRange<'_, WithoutTls, KC, DC, C, IM> {} - /// A read-write range iterator structure. pub struct RwRange<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> { cursor: RwCursor<'txn>, @@ -638,9 +635,6 @@ impl fmt::Debug for RoRevRange<'_, KC, DC, C, IM> { } } -// Only implement Send if the transaction is Send (WithoutTls) -unsafe impl Send for RoRevRange<'_, WithoutTls, KC, DC, C, IM> {} - /// A reverse read-write range iterator structure. pub struct RwRevRange<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> { cursor: RwCursor<'txn>,