pub struct SortedBatch { /* private fields */ }Expand description
A sorted batch of entries (immutable after creation)
Implementations§
Source§impl SortedBatch
impl SortedBatch
Sourcepub fn from_unsorted(entries: Vec<HotEntry>) -> Self
pub fn from_unsorted(entries: Vec<HotEntry>) -> Self
Create from unsorted entries
Sourcepub fn get(&self, key: &[u8]) -> Option<&HotEntry>
pub fn get(&self, key: &[u8]) -> Option<&HotEntry>
Get entry by key - O(1) average, O(log N) worst case
Sourcepub fn prefix_scan(&self, prefix: &[u8]) -> impl Iterator<Item = &HotEntry>
pub fn prefix_scan(&self, prefix: &[u8]) -> impl Iterator<Item = &HotEntry>
Get all entries with given prefix - O(log N + K)
Sourcepub fn timestamp_range(&self) -> (u64, u64)
pub fn timestamp_range(&self) -> (u64, u64)
Get timestamp range
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SortedBatch
impl !RefUnwindSafe for SortedBatch
impl Send for SortedBatch
impl Sync for SortedBatch
impl Unpin for SortedBatch
impl UnsafeUnpin for SortedBatch
impl UnwindSafe for SortedBatch
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