pub struct ReverseKeyCursor<'a, C: ?Sized, K: ?Sized, V: ?Sized, R: ?Sized> { /* private fields */ }Expand description
Cursor that reverses the direction of keys in the underlying cursor.
WARNING: This cursor iterates over keys in descending order, and thus will not work correctly with code that assumes monotonically growing keys.
Implementations§
Trait Implementations§
Source§impl<C, K: ?Sized, V: ?Sized, R: WeightTrait + ?Sized> Cursor<K, V, (), R> for ReverseKeyCursor<'_, C, K, V, R>
impl<C, K: ?Sized, V: ?Sized, R: WeightTrait + ?Sized> Cursor<K, V, (), R> for ReverseKeyCursor<'_, C, K, V, R>
fn weight_factory(&self) -> &'static dyn Factory<R>
Source§fn map_times(&mut self, logic: &mut dyn FnMut(&(), &R))
fn map_times(&mut self, logic: &mut dyn FnMut(&(), &R))
Applies
logic to each pair of time and difference. Intended for
mutation of the closure’s scope.Source§fn map_times_through(&mut self, upper: &(), logic: &mut dyn FnMut(&(), &R))
fn map_times_through(&mut self, upper: &(), logic: &mut dyn FnMut(&(), &R))
Applies
logic to each pair of time and difference, restricted
to times t <= upper.Source§fn weight(&mut self) -> &R
fn weight(&mut self) -> &R
Returns the weight associated with the current key/value pair. This
concept only makes sense for cursors with unit timestamp type (
T=()),
since otherwise there is no singular definition of weight. This method
is more convenient, and may be more efficient, than the equivalent call
to Self::map_times. Read moreSource§fn weight_checked(&mut self) -> &R
fn weight_checked(&mut self) -> &R
Returns the weight associated with the current key/value pair is
T is ();
panics otherwise. Read moreSource§fn map_values(&mut self, logic: &mut dyn FnMut(&V, &R))
fn map_values(&mut self, logic: &mut dyn FnMut(&V, &R))
Apply a function to all values associated with the current key.
Source§fn step_key_reverse(&mut self)
fn step_key_reverse(&mut self)
Moves the cursor to the previous key.
Source§fn seek_key(&mut self, key: &K)
fn seek_key(&mut self, key: &K)
Advances the cursor to the specified key. If
key itself is not
present, advances to the first key greater than key; if there is no
such key, the cursor becomes invalid. Read moreSource§fn seek_key_exact(&mut self, _key: &K, _hash: Option<u64>) -> bool
fn seek_key_exact(&mut self, _key: &K, _hash: Option<u64>) -> bool
Looks up the specified key and returns true if it is present. Read more
Source§fn seek_key_with(&mut self, predicate: &dyn Fn(&K) -> bool)
fn seek_key_with(&mut self, predicate: &dyn Fn(&K) -> bool)
Advances the cursor to the first key that satisfies
predicate.
Assumes that predicate remains true once it turns true.Source§fn seek_key_with_reverse(&mut self, predicate: &dyn Fn(&K) -> bool)
fn seek_key_with_reverse(&mut self, predicate: &dyn Fn(&K) -> bool)
Move the cursor backward to the first key that satisfies
predicate.
Assumes that predicate remains true once it turns true.Source§fn seek_key_reverse(&mut self, key: &K)
fn seek_key_reverse(&mut self, key: &K)
Moves the cursor backward to the specified key. If
key itself is not
present, moves backward to the first key less than key; if there is no
such key, the cursor becomes invalid.Source§fn step_val_reverse(&mut self)
fn step_val_reverse(&mut self)
Moves the cursor to the previous value.
Source§fn seek_val_reverse(&mut self, val: &V)
fn seek_val_reverse(&mut self, val: &V)
Moves the cursor back to the specified value.
Source§fn seek_val_with(&mut self, predicate: &dyn Fn(&V) -> bool)
fn seek_val_with(&mut self, predicate: &dyn Fn(&V) -> bool)
Move the cursor to the first value (for the current key) that satisfies
predicate. Assumes that predicate remains true once it turns true.Source§fn seek_val_with_reverse(&mut self, predicate: &dyn Fn(&V) -> bool)
fn seek_val_with_reverse(&mut self, predicate: &dyn Fn(&V) -> bool)
Move the cursor back to the largest value (for the current key) that
satisfies
predicate. Assumes that predicate remains true once
it turns true.Source§fn rewind_keys(&mut self)
fn rewind_keys(&mut self)
Rewinds the cursor to the first key.
Source§fn fast_forward_keys(&mut self)
fn fast_forward_keys(&mut self)
Moves the cursor to the last key.
Source§fn rewind_vals(&mut self)
fn rewind_vals(&mut self)
Rewinds the cursor to the first value for current key.
Source§fn fast_forward_vals(&mut self)
fn fast_forward_vals(&mut self)
Move the cursor to the last value for the current key.
fn position(&self) -> Option<Position>
Source§fn keyval_valid(&self) -> bool
fn keyval_valid(&self) -> bool
Reports whether the current
(key, value) pair is valid.
Returns false if the cursor has exhausted all pairs.Source§fn step_keyval(&mut self)
fn step_keyval(&mut self)
Moves the cursor to the next
(key, value) pair.Source§fn step_keyval_reverse(&mut self)
fn step_keyval_reverse(&mut self)
Moves the cursor to the previous
(key, value) pair.Auto Trait Implementations§
impl<'a, C, K, V, R> !UnwindSafe for ReverseKeyCursor<'a, C, K, V, R>
impl<'a, C, K, V, R> Freeze for ReverseKeyCursor<'a, C, K, V, R>
impl<'a, C, K, V, R> RefUnwindSafe for ReverseKeyCursor<'a, C, K, V, R>
impl<'a, C, K, V, R> Send for ReverseKeyCursor<'a, C, K, V, R>
impl<'a, C, K, V, R> Sync for ReverseKeyCursor<'a, C, K, V, R>
impl<'a, C, K, V, R> Unpin for ReverseKeyCursor<'a, C, K, V, R>
impl<'a, C, K, V, R> UnsafeUnpin for ReverseKeyCursor<'a, C, K, V, R>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.