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, V> Pwm for PendingMap<K, V>where
K: Ord,
impl<K, V> Pwm for PendingMap<K, V>where
K: Ord,
§type Error = Infallible
type Error = Infallible
The error type returned by the conflict manager.
§type Iter<'a> = Iter<'a, K, EntryValue<V>>
where
Self: 'a
type Iter<'a> = Iter<'a, K, EntryValue<V>> where Self: 'a
The iterator type.
§type IntoIter = IntoIter<K, EntryValue<V>>
type IntoIter = IntoIter<K, EntryValue<V>>
The IntoIterator type.
source§fn new(options: Self::Options) -> Result<Self, Self::Error>
fn new(options: Self::Options) -> Result<Self, Self::Error>
Create a new pending manager with the given options.
source§fn validate_entry(
&self,
_entry: &Entry<Self::Key, Self::Value>
) -> Result<(), Self::Error>
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
fn max_batch_size(&self) -> u64
Returns the maximum batch size in bytes
source§fn max_batch_entries(&self) -> u64
fn max_batch_entries(&self) -> u64
Returns the maximum entries in batch
source§fn estimate_size(&self, _entry: &Entry<Self::Key, Self::Value>) -> u64
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>
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>
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>
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>
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§impl<K, V> PwmComparable for PendingMap<K, V>where
K: Ord,
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>
fn get_comparable<Q>( &self, key: &Q ) -> Result<Option<&EntryValue<Self::Value>>, Self::Error>
Optimized version of
Pwm::get
that accepts borrowed keys.fn get_entry_comparable<Q>( &self, key: &Q ) -> Result<Option<(&Self::Key, &EntryValue<Self::Value>)>, Self::Error>
source§fn contains_key_comparable<Q>(&self, key: &Q) -> Result<bool, Self::Error>
fn contains_key_comparable<Q>(&self, key: &Q) -> Result<bool, Self::Error>
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>
fn remove_entry_comparable<Q>( &mut self, key: &Q ) -> Result<Option<(Self::Key, EntryValue<Self::Value>)>, Self::Error>
Optimized version of
Pwm::remove_entry
that accepts borrowed keys.source§impl<K, V> PwmComparableRange for PendingMap<K, V>where
K: Ord,
impl<K, V> PwmComparableRange for PendingMap<K, V>where
K: Ord,
source§fn range_comparable<T, R>(&self, range: R) -> Self::Range<'_>
fn range_comparable<T, R>(&self, range: R) -> Self::Range<'_>
Returns an iterator over the pending writes.
source§impl<K, V> PwmRange for PendingMap<K, V>where
K: Ord,
impl<K, V> PwmRange for PendingMap<K, V>where
K: Ord,
§type Range<'a> = Range<'a, K, EntryValue<V>>
where
Self: 'a
type Range<'a> = Range<'a, K, EntryValue<V>> where Self: 'a
The iterator type.
Auto Trait Implementations§
impl<K, V> Freeze for PendingMap<K, V>
impl<K, V> RefUnwindSafe for PendingMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for PendingMap<K, V>
impl<K, V> Sync for PendingMap<K, V>
impl<K, V> Unpin for PendingMap<K, V>
impl<K, V> UnwindSafe for PendingMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations§
source§impl<T> AsyncPwm for Twhere
T: Pwm,
impl<T> AsyncPwm for Twhere
T: Pwm,
source§async fn new(
options: <T as AsyncPwm>::Options
) -> Result<T, <T as AsyncPwm>::Error>
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 validate_entry(
&self,
entry: &Entry<<T as AsyncPwm>::Key, <T as AsyncPwm>::Value>
) -> Result<(), <T as AsyncPwm>::Error>
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
fn max_batch_size(&self) -> u64
Returns the maximum batch size in bytes
source§fn max_batch_entries(&self) -> u64
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
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>
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>
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>
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>
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>
async fn rollback(&mut self) -> Result<(), <T as AsyncPwm>::Error>
Rollback the pending writes.
source§impl<T> AsyncPwmComparable for Twhere
T: PwmComparable,
impl<T> AsyncPwmComparable for Twhere
T: PwmComparable,
source§async fn get_comparable<Q>(
&self,
key: &Q
) -> Result<Option<&EntryValue<<T as AsyncPwm>::Value>>, <T as AsyncPwm>::Error>
async fn get_comparable<Q>( &self, key: &Q ) -> Result<Option<&EntryValue<<T as AsyncPwm>::Value>>, <T as AsyncPwm>::Error>
Optimized version of
AsyncPwm::get
that accepts borrowed keys.async fn get_entry_comparable<Q>( &self, key: &Q ) -> Result<Option<(&<T as AsyncPwm>::Key, &EntryValue<<T as AsyncPwm>::Value>)>, <T as AsyncPwm>::Error>
source§async fn contains_key_comparable<Q>(
&self,
key: &Q
) -> Result<bool, <T as AsyncPwm>::Error>
async fn contains_key_comparable<Q>( &self, key: &Q ) -> Result<bool, <T as AsyncPwm>::Error>
Optimized version of
AsyncPwm::contains_key
that accepts borrowed keys.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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