mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-05 01:50:42 +00:00
Fix trait bound of StoreReader::iter (#2360)
* Fix trait bound of StoreReader::iter Similar to `StoreReader::get`, `StoreReader::iter` should only require `DocumentDeserialize` and not `Document`. * Mark the iterator returned by SegmentReader::doc_ids_alive as Send so it can be used in impls of Stream/AsyncIterator.
This commit is contained in:
@@ -406,7 +406,7 @@ impl SegmentReader {
|
||||
}
|
||||
|
||||
/// Returns an iterator that will iterate over the alive document ids
|
||||
pub fn doc_ids_alive(&self) -> Box<dyn Iterator<Item = DocId> + '_> {
|
||||
pub fn doc_ids_alive(&self) -> Box<dyn Iterator<Item = DocId> + Send + '_> {
|
||||
if let Some(alive_bitset) = &self.alive_bitset_opt {
|
||||
Box::new(alive_bitset.iter_alive())
|
||||
} else {
|
||||
|
||||
@@ -14,7 +14,7 @@ use super::Decompressor;
|
||||
use crate::directory::FileSlice;
|
||||
use crate::error::DataCorruption;
|
||||
use crate::fastfield::AliveBitSet;
|
||||
use crate::schema::document::{BinaryDocumentDeserializer, Document, DocumentDeserialize};
|
||||
use crate::schema::document::{BinaryDocumentDeserializer, DocumentDeserialize};
|
||||
use crate::space_usage::StoreSpaceUsage;
|
||||
use crate::store::index::Checkpoint;
|
||||
use crate::DocId;
|
||||
@@ -235,7 +235,7 @@ impl StoreReader {
|
||||
/// Iterator over all Documents in their order as they are stored in the doc store.
|
||||
/// Use this, if you want to extract all Documents from the doc store.
|
||||
/// The `alive_bitset` has to be forwarded from the `SegmentReader` or the results may be wrong.
|
||||
pub fn iter<'a: 'b, 'b, D: Document + DocumentDeserialize>(
|
||||
pub fn iter<'a: 'b, 'b, D: DocumentDeserialize>(
|
||||
&'b self,
|
||||
alive_bitset: Option<&'a AliveBitSet>,
|
||||
) -> impl Iterator<Item = crate::Result<D>> + 'b {
|
||||
|
||||
Reference in New Issue
Block a user