pub struct SparseIndex { /* private fields */ }Expand description
Segment-local sparse index organised as an ordered array.
Implementations§
Source§impl SparseIndex
impl SparseIndex
Sourcepub fn new(entries: Vec<SparseEntry>) -> Self
pub fn new(entries: Vec<SparseEntry>) -> Self
Constructs a sparse index from the provided entries. The entries will be sorted by key to allow binary searches during lookups.
Sourcepub fn locate(
&self,
key: &[u8],
snapshot: SequenceNumber,
) -> Option<VersionPointer>
pub fn locate( &self, key: &[u8], snapshot: SequenceNumber, ) -> Option<VersionPointer>
Attempts to locate a pointer for the provided key that is visible to the snapshot.
Sourcepub fn range(
&self,
start: &[u8],
end: &[u8],
snapshot: SequenceNumber,
) -> Vec<(Vec<u8>, VersionPointer)>
pub fn range( &self, start: &[u8], end: &[u8], snapshot: SequenceNumber, ) -> Vec<(Vec<u8>, VersionPointer)>
Returns a vector with the entries that fall within the provided key range.
Trait Implementations§
Source§impl Clone for SparseIndex
impl Clone for SparseIndex
Source§impl Debug for SparseIndex
impl Debug for SparseIndex
Auto Trait Implementations§
impl Freeze for SparseIndex
impl RefUnwindSafe for SparseIndex
impl Send for SparseIndex
impl Sync for SparseIndex
impl Unpin for SparseIndex
impl UnsafeUnpin for SparseIndex
impl UnwindSafe for SparseIndex
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