Trait txn_core::sync::PwmComparable

source ·
pub trait PwmComparable: Pwm {
    // Required methods
    fn get_comparable<Q>(
        &self,
        key: &Q
    ) -> Result<Option<&EntryValue<Self::Value>>, Self::Error>
       where Self::Key: Borrow<Q>,
             Q: Ord + ?Sized;
    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;
    fn contains_key_comparable<Q>(&self, key: &Q) -> Result<bool, Self::Error>
       where Self::Key: Borrow<Q>,
             Q: Ord + ?Sized;
    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;
}
Expand description

An optimized version of the Pwm trait that if your pending writes manager is depend on the order.

Required Methods§

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<K, V> PwmComparable for BTreeMap<K, EntryValue<V>>
where K: Ord,

source§

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

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 K: Borrow<Q>, Q: Ord + ?Sized,

source§

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

Implementors§