Skip to main content

CursorList

Struct CursorList 

Source
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>

Source§

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

Storage required by the cursor.
Source§

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

Alias for a borrowed key.
Source§

type ValOwn = <C as Cursor>::ValOwn

Alias for an owned val.
Source§

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

Alias for a borrowed val.
Source§

type Time = <C as Cursor>::Time

Alias for an owned time.
Source§

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

Alias for a borrowed time.
Source§

type Diff = <C as Cursor>::Diff

Alias for an owned diff.
Source§

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

Alias for a borrowed diff.
Source§

type KeyContainer = <C as Cursor>::KeyContainer

Container for update keys.
Source§

type ValContainer = <C as Cursor>::ValContainer

Container for update vals.
Source§

type TimeContainer = <C as Cursor>::TimeContainer

Container for times.
Source§

type DiffContainer = <C as Cursor>::DiffContainer

Container for diffs.
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 get_key<'a>(&self, storage: &'a Vec<C::Storage>) -> Option<Self::Key<'a>>

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

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

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

fn map_times<L: FnMut(Self::TimeGat<'_>, Self::DiffGat<'_>)>( &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 owned_val(val: Self::Val<'_>) -> Self::ValOwn

Construct an owned val from a reference.
Source§

fn owned_time(time: Self::TimeGat<'_>) -> Self::Time

Construct an owned time from a reference.
Source§

fn owned_diff(diff: Self::DiffGat<'_>) -> Self::Diff

Construct an owned diff from a reference.
Source§

fn clone_time_onto(time: Self::TimeGat<'_>, onto: &mut Self::Time)

Clones a reference time onto an owned time.
Source§

fn populate_key<'a>( &mut self, storage: &'a Self::Storage, key: Self::Key<'a>, meet: Option<&Self::Time>, target: &mut EditList<Self::Val<'a>, Self::Time, Self::Diff>, )

Loads target with all updates associated with the supplied key. Read more
Source§

fn to_vec<K, IK, V, IV>( &mut self, storage: &Self::Storage, into_key: IK, into_val: IV, ) -> Vec<((K, V), Vec<(Self::Time, Self::Diff)>)>
where IK: for<'a> Fn(Self::Key<'a>) -> K, IV: for<'a> Fn(Self::Val<'a>) -> 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> UnsafeUnpin for CursorList<C>

§

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<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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'a, S, T> Semigroup<&'a S> for T
where T: Semigroup<S>,

Source§

fn plus_equals(&mut self, rhs: &&'a S)

The method of std::ops::AddAssign, for types that do not implement AddAssign.
Source§

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

Source§

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>,

Source§

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.