From a7461c68ecd7fcf4f2a395083b40d0f95ad14cb7 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 21 Aug 2020 15:40:21 +0300 Subject: [PATCH] Add Send implementation for WriteBatch (#453) --- CHANGELOG.md | 1 + src/lib.rs | 3 ++- src/write_batch.rs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caec758..23334c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Export the `DEFAULT_COLUMN_FAMILY_NAME` constant. * Implement `Clone` trait for `Options`. +* Added `Send` implementation to `WriteBatch`. ## 0.14.0 (2020-04-22) diff --git a/src/lib.rs b/src/lib.rs index aaa0529..249f386 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -163,7 +163,7 @@ mod test { use super::{ BlockBasedOptions, ColumnFamily, ColumnFamilyDescriptor, DBIterator, DBRawIterator, IngestExternalFileOptions, Options, PlainTableFactoryOptions, ReadOptions, Snapshot, - SstFileWriter, WriteOptions, DB, + SstFileWriter, WriteBatch, WriteOptions, DB, }; #[test] @@ -188,6 +188,7 @@ mod test { is_send::(); is_send::(); is_send::(); + is_send::(); } #[test] diff --git a/src/write_batch.rs b/src/write_batch.rs index c07fe6b..a2566bd 100644 --- a/src/write_batch.rs +++ b/src/write_batch.rs @@ -279,3 +279,5 @@ impl Drop for WriteBatch { unsafe { ffi::rocksdb_writebatch_destroy(self.inner) } } } + +unsafe impl Send for WriteBatch {}