pub struct CursorPair<C1, C2> { /* private fields */ }
Expand description

A cursor over the combined updates of two different cursors.

A CursorPair wraps two cursors over the same types of updates, and provides navigation through their merged updates.

Trait Implementations§

source§

impl<K, V, T, R, C1, C2> Cursor for CursorPair<C1, C2>where K: Ord, V: Ord, C1: Cursor<Key = K, Val = V, Time = T, Diff = R>, C2: Cursor<Key = K, Val = V, Time = T, Diff = R>,

§

type Key = K

Key by which updates are indexed.
§

type Val = V

Values associated with keys.
§

type Time = T

Timestamps associated with updates
§

type Diff = R

Associated update.
§

type Storage = (<C1 as Cursor>::Storage, <C2 as Cursor>::Storage)

Storage required by the cursor.
source§

fn key_valid(&self, storage: &(C1::Storage, C2::Storage)) -> bool

Indicates if the current key is valid. Read more
source§

fn val_valid(&self, storage: &(C1::Storage, C2::Storage)) -> bool

Indicates if the current value is valid. Read more
source§

fn key<'a>(&self, storage: &'a (C1::Storage, C2::Storage)) -> &'a K

A reference to the current key. Asserts if invalid.
source§

fn val<'a>(&self, storage: &'a (C1::Storage, C2::Storage)) -> &'a V

A reference to the current value. Asserts if invalid.
source§

fn map_times<L: FnMut(&T, &R)>( &mut self, storage: &(C1::Storage, C2::Storage), logic: L )

Applies logic to each pair of time and difference. Intended for mutation of the closure’s scope.
source§

fn step_key(&mut self, storage: &(C1::Storage, C2::Storage))

Advances the cursor to the next key.
source§

fn seek_key(&mut self, storage: &(C1::Storage, C2::Storage), key: &K)

Advances the cursor to the specified key.
source§

fn step_val(&mut self, storage: &(C1::Storage, C2::Storage))

Advances the cursor to the next value.
source§

fn seek_val(&mut self, storage: &(C1::Storage, C2::Storage), val: &V)

Advances the cursor to the specified value.
source§

fn rewind_keys(&mut self, storage: &(C1::Storage, C2::Storage))

Rewinds the cursor to the first key.
source§

fn rewind_vals(&mut self, storage: &(C1::Storage, C2::Storage))

Rewinds the cursor to the first value for current key.
source§

fn get_key<'a>(&self, storage: &'a Self::Storage) -> Option<&'a Self::Key>

Returns a reference to the current key, if valid.
source§

fn get_val<'a>(&self, storage: &'a Self::Storage) -> Option<&'a Self::Val>

Returns a reference to the current value, if valid.

Auto Trait Implementations§

§

impl<C1, C2> RefUnwindSafe for CursorPair<C1, C2>where C1: RefUnwindSafe, C2: RefUnwindSafe,

§

impl<C1, C2> Send for CursorPair<C1, C2>where C1: Send, C2: Send,

§

impl<C1, C2> Sync for CursorPair<C1, C2>where C1: Sync, C2: Sync,

§

impl<C1, C2> Unpin for CursorPair<C1, C2>where C1: Unpin, C2: Unpin,

§

impl<C1, C2> UnwindSafe for CursorPair<C1, C2>where C1: UnwindSafe, C2: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.