pub struct CursorList<C> { /* private fields */ }
Expand description

Provides a cursor interface over a list of cursors.

The CursorList tracks the indices of cursors with the minimum key, and the the indices of cursors with the minimum key and minimum value. It performs no clever management of these sets otherwise.

Implementations§

source§

impl<C: Cursor> CursorList<C>

source

pub fn new(cursors: Vec<C>, storage: &[C::Storage]) -> Self

Creates a new cursor list from pre-existing cursors.

Trait Implementations§

source§

impl<C: Cursor> Cursor for CursorList<C>

§

type Key<'a> = <C as Cursor>::Key<'a>

Key by which updates are indexed.
§

type KeyOwned = <C as Cursor>::KeyOwned

Owned version of the above.
§

type Val<'a> = <C as Cursor>::Val<'a>

Values associated with keys.
§

type Time = <C as Cursor>::Time

Timestamps associated with updates
§

type Diff = <C as Cursor>::Diff

Associated update.
§

type Storage = Vec<<C as Cursor>::Storage>

Storage required by the cursor.
source§

fn key_valid(&self, _storage: &Vec<C::Storage>) -> bool

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

fn val_valid(&self, _storage: &Vec<C::Storage>) -> bool

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

fn key<'a>(&self, storage: &'a Vec<C::Storage>) -> Self::Key<'a>

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

fn val<'a>(&self, storage: &'a Vec<C::Storage>) -> Self::Val<'a>

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

fn map_times<L: FnMut(&Self::Time, &Self::Diff)>( &mut self, storage: &Vec<C::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: &Vec<C::Storage>)

Advances the cursor to the next key.
source§

fn seek_key(&mut self, storage: &Vec<C::Storage>, key: Self::Key<'_>)

Advances the cursor to the specified key.
source§

fn step_val(&mut self, storage: &Vec<C::Storage>)

Advances the cursor to the next value.
source§

fn seek_val(&mut self, storage: &Vec<C::Storage>, val: Self::Val<'_>)

Advances the cursor to the specified value.
source§

fn rewind_keys(&mut self, storage: &Vec<C::Storage>)

Rewinds the cursor to the first key.
source§

fn rewind_vals(&mut self, storage: &Vec<C::Storage>)

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

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

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

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

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

fn seek_key_owned(&mut self, storage: &Self::Storage, key: &Self::KeyOwned)

Convenience method to get access by reference to an owned key.
source§

fn to_vec<V, F>( &mut self, from: F, storage: &Self::Storage ) -> Vec<((Self::KeyOwned, V), Vec<(Self::Time, Self::Diff)>)>
where F: Fn(Self::Val<'_>) -> V,

Rewinds the cursor and outputs its contents to a Vec
source§

impl<C: Debug> Debug for CursorList<C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C> Freeze for CursorList<C>

§

impl<C> RefUnwindSafe for CursorList<C>
where C: RefUnwindSafe,

§

impl<C> Send for CursorList<C>
where C: Send,

§

impl<C> Sync for CursorList<C>
where C: Sync,

§

impl<C> Unpin for CursorList<C>
where C: Unpin,

§

impl<C> UnwindSafe for CursorList<C>
where C: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<R, O, T> CopyOnto<ConsecutiveOffsetPairs<R, O>> for T
where R: Region<Index = (usize, usize)>, O: OffsetContainer<usize>, T: CopyOnto<R>,

source§

fn copy_onto( self, target: &mut ConsecutiveOffsetPairs<R, O> ) -> <ConsecutiveOffsetPairs<R, O> as Region>::Index

Copy self into the target container, returning an index that allows to look up the corresponding read item.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where 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<R, T> PushInto<FlatStack<R>> for T
where R: Region + Clone + 'static, T: CopyOnto<R>,

source§

fn push_into(self, target: &mut FlatStack<R>)

Push self into the target container.
source§

impl<T> PushInto<Vec<T>> for T

source§

fn push_into(self, target: &mut Vec<T>)

Push self into the target container.
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.