pub struct ForwardInMemoryCursor<'a, K, V> { /* private fields */ }Expand description
The implementation of forward-only in memory cursor over the entries.
The cursor operates under the assumption that the supplied collection is pre-sorted.
Implementations§
Source§impl<'a, K, V> ForwardInMemoryCursor<'a, K, V>
impl<'a, K, V> ForwardInMemoryCursor<'a, K, V>
Sourcepub const fn new(entries: &'a [(K, V)]) -> Self
pub const fn new(entries: &'a [(K, V)]) -> Self
Create new forward cursor positioned at the beginning of the collection.
The cursor expects all of the entries to have been sorted in advance.
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns true if the cursor is empty, regardless of its position.
Sourcepub fn has_any<F>(&self, predicate: F) -> bool
pub fn has_any<F>(&self, predicate: F) -> bool
Returns true if any entry satisfies the predicate.
Source§impl<K: Ord, V> ForwardInMemoryCursor<'_, K, V>
impl<K: Ord, V> ForwardInMemoryCursor<'_, K, V>
Sourcepub fn seek(&mut self, key: &K) -> Option<&(K, V)>
pub fn seek(&mut self, key: &K) -> Option<&(K, V)>
Returns the first entry from the current cursor position that’s greater or equal to the provided key. This method advances the cursor forward.
Sourcepub fn first_after(&mut self, key: &K) -> Option<&(K, V)>
pub fn first_after(&mut self, key: &K) -> Option<&(K, V)>
Returns the first entry from the current cursor position that’s greater than the provided key. This method advances the cursor forward.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V> Freeze for ForwardInMemoryCursor<'a, K, V>
impl<'a, K, V> RefUnwindSafe for ForwardInMemoryCursor<'a, K, V>where
&'a [(K, V)]: RefUnwindSafe,
impl<'a, K, V> Send for ForwardInMemoryCursor<'a, K, V>
impl<'a, K, V> Sync for ForwardInMemoryCursor<'a, K, V>
impl<'a, K, V> Unpin for ForwardInMemoryCursor<'a, K, V>
impl<'a, K, V> UnsafeUnpin for ForwardInMemoryCursor<'a, K, V>where
&'a [(K, V)]: UnsafeUnpin,
impl<'a, K, V> UnwindSafe for ForwardInMemoryCursor<'a, K, V>where
&'a [(K, V)]: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes