pub struct MmapCursor<'a> { /* private fields */ }Expand description
Cursor over one dimension of an mmap’d index: a position within the dimension’s entries, read straight from the mapping.
Implementations§
Source§impl<'a> MmapCursor<'a>
impl<'a> MmapCursor<'a>
Sourcepub fn new(entries: &'a [PostingEntry]) -> Self
pub fn new(entries: &'a [PostingEntry]) -> Self
Cursor at the start of entries, which must be sorted by id with no
duplicates (the writer guarantees it).
Sourcepub fn open(data: &'a MmapPostingData, dim: DimId) -> Option<Self>
pub fn open(data: &'a MmapPostingData, dim: DimId) -> Option<Self>
Cursor for dim (a remapped dimension index), None when the
dimension has no postings.
Trait Implementations§
Source§impl<'a> Clone for MmapCursor<'a>
impl<'a> Clone for MmapCursor<'a>
Source§fn clone(&self) -> MmapCursor<'a>
fn clone(&self) -> MmapCursor<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for MmapCursor<'a>
impl<'a> Debug for MmapCursor<'a>
Source§impl PostingCursor for MmapCursor<'_>
impl PostingCursor for MmapCursor<'_>
Source§fn peek(&self) -> Option<Posting>
fn peek(&self) -> Option<Posting>
The current element, or
None once the cursor is past the end.Source§fn seek(&mut self, target: RecordId) -> Option<Posting>
fn seek(&mut self, target: RecordId) -> Option<Posting>
Move forward to the first element whose id is
>= target and return
it. Returns None when no such element exists; the cursor is then
past the end. Never moves backwards.Source§fn last_id(&self) -> Option<RecordId>
fn last_id(&self) -> Option<RecordId>
Id of the last element of the whole list (regardless of position);
None for an empty list.Source§fn drain_through(&mut self, hi: RecordId, visit: impl FnMut(RecordId, Weight))
fn drain_through(&mut self, hi: RecordId, visit: impl FnMut(RecordId, Weight))
Consume every element with id
<= hi, handing each (id, weight) to
visit in id order. Leaves the cursor on the first element above
hi (or past the end).Source§fn upper_bound(&self) -> Weight
fn upper_bound(&self) -> Weight
An upper bound on the weights of the elements not yet consumed, the
current one included.
f32::NEG_INFINITY once past the end.Source§fn lower_bound(&self) -> Weight
fn lower_bound(&self) -> Weight
A lower bound on the weights of the elements not yet consumed. The
default is unbounded, which is always correct; storages that track a
suffix minimum can tighten it so negative query weights prune too.
Source§fn is_exhausted(&self) -> bool
fn is_exhausted(&self) -> bool
True once the cursor is past the end.
Auto Trait Implementations§
impl<'a> Freeze for MmapCursor<'a>
impl<'a> RefUnwindSafe for MmapCursor<'a>
impl<'a> Send for MmapCursor<'a>
impl<'a> Sync for MmapCursor<'a>
impl<'a> Unpin for MmapCursor<'a>
impl<'a> UnsafeUnpin for MmapCursor<'a>
impl<'a> UnwindSafe for MmapCursor<'a>
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