Skip to content

Commit

Permalink
Prefer implementing Send on the RoCursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Mar 5, 2025
1 parent 92003c2 commit 401953c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
3 changes: 3 additions & 0 deletions heed/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ impl<T> 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>,
}
Expand Down
6 changes: 0 additions & 6 deletions heed/src/iterator/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ impl<KC, DC, IM> fmt::Debug for RoIter<'_, KC, DC, IM> {
}
}

// Only implement Send if the transaction is Send (WithoutTls)
unsafe impl<KC, DC, IM> Send for RoIter<'_, WithoutTls, KC, DC, IM> {}

/// A read-write iterator structure.
pub struct RwIter<'txn, KC, DC, IM = MoveThroughDuplicateValues> {
cursor: RwCursor<'txn>,
Expand Down Expand Up @@ -559,9 +556,6 @@ impl<KC, DC, IM> fmt::Debug for RoRevIter<'_, KC, DC, IM> {
}
}

// Only implement Send if the transaction is Send (WithoutTls)
unsafe impl<KC, DC, IM> Send for RoRevIter<'_, WithoutTls, KC, DC, IM> {}

/// A reverse read-write iterator structure.
pub struct RwRevIter<'txn, KC, DC, IM = MoveThroughDuplicateValues> {
cursor: RwCursor<'txn>,
Expand Down
6 changes: 0 additions & 6 deletions heed/src/iterator/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ impl<KC, DC, C, IM> fmt::Debug for RoPrefix<'_, KC, DC, C, IM> {
}
}

// Only implement Send if the transaction is Send (WithoutTls)
unsafe impl<KC, DC, IM> 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>,
Expand Down Expand Up @@ -596,9 +593,6 @@ impl<T, KC, DC, C, IM> fmt::Debug for RoRevPrefix<'_, T, KC, DC, C, IM> {
}
}

// Only implement Send if the transaction is Send (WithoutTls)
unsafe impl<KC, DC, IM> 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>,
Expand Down
6 changes: 0 additions & 6 deletions heed/src/iterator/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ impl<KC, DC, C, IM> fmt::Debug for RoRange<'_, KC, DC, C, IM> {
}
}

// Only implement Send if the transaction is Send (WithoutTls)
unsafe impl<KC, DC, C, IM> 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>,
Expand Down Expand Up @@ -638,9 +635,6 @@ impl<KC, DC, C, IM> fmt::Debug for RoRevRange<'_, KC, DC, C, IM> {
}
}

// Only implement Send if the transaction is Send (WithoutTls)
unsafe impl<KC, DC, C, IM> 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>,
Expand Down

0 comments on commit 401953c

Please sign in to comment.