Struct skipdb_core::PendingMap

source ·
pub struct PendingMap<K, V> { /* private fields */ }
Expand description

Pending write manger implementation for [EquivalentDB] and [ComparableDB].

Trait Implementations§

source§

impl<K: Clone, V: Clone> Clone for PendingMap<K, V>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<K, V> Pwm for PendingMap<K, V>
where K: Ord,

§

type Error = Infallible

The error type returned by the conflict manager.
§

type Key = K

The key type.
§

type Value = V

The value type.
§

type Options = Options

The options type used to create the pending manager.
§

type Iter<'a> = Iter<'a, K, EntryValue<V>> where Self: 'a

The iterator type.
§

type IntoIter = IntoIter<K, EntryValue<V>>

The IntoIterator type.
source§

fn new(options: Self::Options) -> Result<Self, Self::Error>

Create a new pending manager with the given options.
source§

fn is_empty(&self) -> bool

Returns true if the buffer is empty.
source§

fn len(&self) -> usize

Returns the number of elements in the buffer.
source§

fn validate_entry( &self, _entry: &Entry<Self::Key, Self::Value> ) -> Result<(), Self::Error>

Validate if the entry is valid for this database. Read more
source§

fn max_batch_size(&self) -> u64

Returns the maximum batch size in bytes
source§

fn max_batch_entries(&self) -> u64

Returns the maximum entries in batch
source§

fn estimate_size(&self, _entry: &Entry<Self::Key, Self::Value>) -> u64

Returns the estimated size of the entry in bytes when persisted in the database.
source§

fn contains_key(&self, key: &Self::Key) -> Result<bool, Self::Error>

Returns true if the pending manager contains the key.
source§

fn get( &self, key: &Self::Key ) -> Result<Option<&EntryValue<Self::Value>>, Self::Error>

Returns a reference to the value corresponding to the key.
source§

fn insert( &mut self, key: Self::Key, value: EntryValue<Self::Value> ) -> Result<(), Self::Error>

Inserts a key-value pair into the er.
source§

fn remove_entry( &mut self, key: &Self::Key ) -> Result<Option<(Self::Key, EntryValue<Self::Value>)>, Self::Error>

Removes a key from the pending writes, returning the key-value pair if the key was previously in the pending writes.
source§

fn iter(&self) -> Self::Iter<'_>

Returns an iterator over the pending writes.
source§

fn into_iter(self) -> Self::IntoIter

Returns an iterator that consumes the pending writes.
source§

fn rollback(&mut self) -> Result<(), Self::Error>

Rollback the pending writes.
source§

impl<K, V> PwmComparable for PendingMap<K, V>
where K: Ord,

source§

fn get_comparable<Q>( &self, key: &Q ) -> Result<Option<&EntryValue<Self::Value>>, Self::Error>
where Self::Key: Borrow<Q>, Q: Ord + ?Sized,

Optimized version of Pwm::get that accepts borrowed keys.
source§

fn get_entry_comparable<Q>( &self, key: &Q ) -> Result<Option<(&Self::Key, &EntryValue<Self::Value>)>, Self::Error>
where Self::Key: Borrow<Q>, Q: Ord + ?Sized,

source§

fn contains_key_comparable<Q>(&self, key: &Q) -> Result<bool, Self::Error>
where Self::Key: Borrow<Q>, Q: Ord + ?Sized,

Optimized version of Pwm::contains_key that accepts borrowed keys.
source§

fn remove_entry_comparable<Q>( &mut self, key: &Q ) -> Result<Option<(Self::Key, EntryValue<Self::Value>)>, Self::Error>
where Self::Key: Borrow<Q>, Q: Ord + ?Sized,

Optimized version of Pwm::remove_entry that accepts borrowed keys.
source§

impl<K, V> PwmComparableRange for PendingMap<K, V>
where K: Ord,

source§

fn range_comparable<T, R>(&self, range: R) -> Self::Range<'_>
where T: ?Sized + Ord, Self::Key: Borrow<T> + Ord, R: RangeBounds<T>,

Returns an iterator over the pending writes.
source§

impl<K, V> PwmRange for PendingMap<K, V>
where K: Ord,

§

type Range<'a> = Range<'a, K, EntryValue<V>> where Self: 'a

The iterator type.
source§

fn range<R: RangeBounds<Self::Key>>(&self, range: R) -> Self::Range<'_>

Returns an iterator over the pending writes.

Auto Trait Implementations§

§

impl<K, V> Freeze for PendingMap<K, V>

§

impl<K, V> RefUnwindSafe for PendingMap<K, V>

§

impl<K, V> Send for PendingMap<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for PendingMap<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for PendingMap<K, V>

§

impl<K, V> UnwindSafe for PendingMap<K, V>

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> AsyncPwm for T
where T: Pwm,

§

type Error = <T as Pwm>::Error

The error type returned by the conflict manager.
§

type Key = <T as Pwm>::Key

The key type.
§

type Value = <T as Pwm>::Value

The value type.
§

type Options = <T as Pwm>::Options

The options type used to create the pending manager.
§

type Iter<'a> = <T as Pwm>::Iter<'a> where T: 'a

The iterator type that borrows the pending writes.
§

type IntoIter = <T as Pwm>::IntoIter

The iterator type that consumes the pending writes.
source§

async fn new( options: <T as AsyncPwm>::Options ) -> Result<T, <T as AsyncPwm>::Error>

Create a new pending manager with the given options.
source§

async fn is_empty(&self) -> bool

Returns true if the buffer is empty.
source§

async fn len(&self) -> usize

Returns the number of elements in the buffer.
source§

async fn validate_entry( &self, entry: &Entry<<T as AsyncPwm>::Key, <T as AsyncPwm>::Value> ) -> Result<(), <T as AsyncPwm>::Error>

Validate if the entry is valid for this database. Read more
source§

fn max_batch_size(&self) -> u64

Returns the maximum batch size in bytes
source§

fn max_batch_entries(&self) -> u64

Returns the maximum entries in batch
source§

fn estimate_size( &self, entry: &Entry<<T as AsyncPwm>::Key, <T as AsyncPwm>::Value> ) -> u64

Returns the estimated size of the entry in bytes when persisted in the database.
source§

async fn get( &self, key: &<T as AsyncPwm>::Key ) -> Result<Option<&EntryValue<<T as AsyncPwm>::Value>>, <T as AsyncPwm>::Error>

Returns a reference to the value corresponding to the key.
source§

async fn contains_key( &self, key: &<T as AsyncPwm>::Key ) -> Result<bool, <T as AsyncPwm>::Error>

Returns true if the pending manager contains the key.
source§

async fn insert( &mut self, key: <T as AsyncPwm>::Key, value: EntryValue<<T as AsyncPwm>::Value> ) -> Result<(), <T as AsyncPwm>::Error>

Inserts a key-value pair into the er.
source§

async fn remove_entry( &mut self, key: &<T as AsyncPwm>::Key ) -> Result<Option<(<T as AsyncPwm>::Key, EntryValue<<T as AsyncPwm>::Value>)>, <T as AsyncPwm>::Error>

Removes a key from the pending writes, returning the key-value pair if the key was previously in the pending writes.
source§

async fn rollback(&mut self) -> Result<(), <T as AsyncPwm>::Error>

Rollback the pending writes.
source§

async fn iter( &self ) -> impl Iterator<Item = (&<T as AsyncPwm>::Key, &EntryValue<<T as AsyncPwm>::Value>)>

Returns an iterator over the pending writes.
source§

async fn into_iter( self ) -> impl Iterator<Item = (<T as AsyncPwm>::Key, EntryValue<<T as AsyncPwm>::Value>)>

Returns an iterator that consumes the pending writes.
source§

impl<T> AsyncPwmComparable for T
where T: PwmComparable,

source§

async fn get_comparable<Q>( &self, key: &Q ) -> Result<Option<&EntryValue<<T as AsyncPwm>::Value>>, <T as AsyncPwm>::Error>
where <T as AsyncPwm>::Key: Borrow<Q>, Q: Ord + ?Sized,

Optimized version of AsyncPwm::get that accepts borrowed keys.
source§

async fn get_entry_comparable<Q>( &self, key: &Q ) -> Result<Option<(&<T as AsyncPwm>::Key, &EntryValue<<T as AsyncPwm>::Value>)>, <T as AsyncPwm>::Error>
where <T as AsyncPwm>::Key: Borrow<Q>, Q: Ord + ?Sized,

source§

async fn contains_key_comparable<Q>( &self, key: &Q ) -> Result<bool, <T as AsyncPwm>::Error>
where <T as AsyncPwm>::Key: Borrow<Q>, Q: Ord + ?Sized,

Optimized version of AsyncPwm::contains_key that accepts borrowed keys.
source§

async fn remove_entry_comparable<Q>( &mut self, key: &Q ) -> Result<Option<(<T as AsyncPwm>::Key, EntryValue<<T as AsyncPwm>::Value>)>, <T as AsyncPwm>::Error>
where <T as AsyncPwm>::Key: Borrow<Q>, Q: Ord + ?Sized,

Optimized version of AsyncPwm::remove_entry that accepts borrowed keys.
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<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

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> ToOwned for T
where T: Clone,

§

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

§

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.