pub struct DocumentsBatchReader<R> { /* private fields */ }
Expand description
The DocumentsBatchReader
provides a way to iterate over documents that have been created with
a DocumentsBatchWriter
.
The documents are returned in the form of obkv::Reader
where each field is identified with a
FieldId
. The mapping between the field ids and the field names is done thanks to the index.
Implementations§
Source§impl<R: Read + Seek> DocumentsBatchReader<R>
impl<R: Read + Seek> DocumentsBatchReader<R>
pub fn new( cursor: DocumentsBatchCursor<R>, fields_index: DocumentsBatchIndex, ) -> Self
Sourcepub fn from_reader(reader: R) -> Result<Self, Error>
pub fn from_reader(reader: R) -> Result<Self, Error>
Construct a DocumentsReader
from a reader.
It first retrieves the index, then moves to the first document. Use the into_cursor
method to iterator over the documents, from the first to the last.
pub fn documents_count(&self) -> u32
pub fn is_empty(&self) -> bool
pub fn documents_batch_index(&self) -> &DocumentsBatchIndex
Sourcepub fn into_cursor_and_fields_index(
self,
) -> (DocumentsBatchCursor<R>, DocumentsBatchIndex)
pub fn into_cursor_and_fields_index( self, ) -> (DocumentsBatchCursor<R>, DocumentsBatchIndex)
This method returns a forward cursor over the documents.
Auto Trait Implementations§
impl<R> Freeze for DocumentsBatchReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for DocumentsBatchReader<R>where
R: RefUnwindSafe,
impl<R> Send for DocumentsBatchReader<R>where
R: Send,
impl<R> Sync for DocumentsBatchReader<R>where
R: Sync,
impl<R> Unpin for DocumentsBatchReader<R>where
R: Unpin,
impl<R> UnwindSafe for DocumentsBatchReader<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more