Skip to main content

DelegatingCursor

Struct DelegatingCursor 

Source
pub struct DelegatingCursor<'s, K, V, T, R>(pub Box<dyn ClonableCursor<'s, K, V, T, R> + Send + 's>)
where
    K: ?Sized,
    V: ?Sized,
    R: ?Sized;
Expand description

A wrapper around a dyn Cursor to allow choice of implementations at runtime.

Tuple Fields§

§0: Box<dyn ClonableCursor<'s, K, V, T, R> + Send + 's>

Trait Implementations§

Source§

impl<K, V, T, R> Clone for DelegatingCursor<'_, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K, V, T, R> Cursor<K, V, T, R> for DelegatingCursor<'_, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized,

Source§

fn weight_factory(&self) -> &'static dyn Factory<R>

Source§

fn key(&self) -> &K

A reference to the current key. Panics if invalid.
Source§

fn val(&self) -> &V

A reference to the current value. Panics if invalid.
Source§

fn map_times(&mut self, logic: &mut dyn FnMut(&T, &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: &T, logic: &mut dyn FnMut(&T, &R))

Applies logic to each pair of time and difference, restricted to times t <= upper.
Source§

fn map_values(&mut self, logic: &mut dyn FnMut(&V, &R))
where T: PartialEq<()>,

Apply a function to all values associated with the current key.
Source§

fn weight(&mut self) -> &R
where T: PartialEq<()>,

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

fn weight_checked(&mut self) -> &R

Returns the weight associated with the current key/value pair is T is (); panics otherwise. Read more
Source§

fn key_valid(&self) -> bool

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

fn val_valid(&self) -> bool

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

fn step_key(&mut self)

Advances the cursor to the next key.
Source§

fn step_key_reverse(&mut self)

Moves the cursor to the previous key.
Source§

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

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)

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)

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)

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(&mut self)

Advances the cursor to the next value.
Source§

fn seek_val(&mut self, val: &V)

Advances the cursor to the specified value.
Source§

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 rewind_keys(&mut self)

Rewinds the cursor to the first key.
Source§

fn fast_forward_keys(&mut self)

Moves the cursor to the last key.
Source§

fn rewind_vals(&mut self)

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

fn step_val_reverse(&mut self)

Moves the cursor to the previous value.
Source§

fn seek_val_reverse(&mut self, val: &V)

Moves the cursor back to the specified value.
Source§

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 fast_forward_vals(&mut self)

Move the cursor to the last value for the current key.
Source§

fn position(&self) -> Option<Position>

Source§

fn get_key(&self) -> Option<&K>

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

fn get_val(&self) -> Option<&V>

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

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 keyval(&self) -> (&K, &V)

Returns current (key, value) pair. Panics if invalid.
Source§

fn step_keyval(&mut self)

Moves the cursor to the next (key, value) pair.
Source§

fn step_keyval_reverse(&mut self)

Moves the cursor to the previous (key, value) pair.
Source§

fn seek_keyval(&mut self, key: &K, val: &V)
where K: PartialEq,

Advance the cursor to the specified (key, value) pair.
Source§

fn seek_keyval_reverse(&mut self, key: &K, val: &V)
where K: PartialEq,

Moves the cursor back to the specified (key, value) pair.
Source§

impl<'s, K, V, T: Debug, R> Debug for DelegatingCursor<'s, K, V, T, R>
where K: ?Sized + Debug, V: ?Sized + Debug, R: ?Sized + Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'s, K, V, T, R> SizeOf for DelegatingCursor<'s, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized, Box<dyn ClonableCursor<'s, K, V, T, R> + Send + 's>: SizeOf,

Source§

fn size_of_children(&self, context: &mut Context)

Gets the size of all “children” owned by this value, not including the size of the value itself. Read more
Source§

fn size_of(&self) -> TotalSize

Gets the total size of the current value
Source§

fn size_of_with_context(&self, context: &mut Context)

Adds the size of the current value to the given Context, including both the size of the value itself and all of its children

Auto Trait Implementations§

§

impl<'s, K, V, T, R> !RefUnwindSafe for DelegatingCursor<'s, K, V, T, R>

§

impl<'s, K, V, T, R> !Sync for DelegatingCursor<'s, K, V, T, R>

§

impl<'s, K, V, T, R> !UnwindSafe for DelegatingCursor<'s, K, V, T, R>

§

impl<'s, K, V, T, R> Freeze for DelegatingCursor<'s, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized,

§

impl<'s, K, V, T, R> Send for DelegatingCursor<'s, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized,

§

impl<'s, K, V, T, R> Unpin for DelegatingCursor<'s, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized,

§

impl<'s, K, V, T, R> UnsafeUnpin for DelegatingCursor<'s, K, V, T, R>
where K: ?Sized, V: ?Sized, R: ?Sized,

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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<'s, K, V, T, R, C> ClonableCursor<'s, K, V, T, R> for C
where C: Cursor<K, V, T, R> + Debug + Clone + Send + 's, K: ?Sized, V: ?Sized, R: ?Sized,

Source§

fn clone_boxed(&self) -> Box<dyn ClonableCursor<'s, K, V, T, R> + Send + 's>

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Data for T
where T: Clone + 'static,

Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<K, V, T, C> ZCursor<K, V, T> for C
where C: Cursor<K, V, T, dyn WeightTyped<Type = i64>>, K: ?Sized, V: ?Sized,