Struct crossbeam_skiplist::map::SkipMap [−][src]
pub struct SkipMap<K, V> { /* fields omitted */ }
A map based on a lock-free skip list.
Implementations
impl<K, V> SkipMap<K, V>
[src]
impl<K, V> SkipMap<K, V>
[src]pub fn new() -> SkipMap<K, V>
[src]
Returns a new, empty map.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the map is empty.
pub fn len(&self) -> usize
[src]
Returns the number of entries in the map.
If the map is being concurrently modified, consider the returned number just an approximation without any guarantees.
impl<K, V> SkipMap<K, V> where
K: Ord,
[src]
impl<K, V> SkipMap<K, V> where
K: Ord,
[src]pub fn front(&self) -> Option<Entry<'_, K, V>>
[src]
Returns the entry with the smallest key.
pub fn back(&self) -> Option<Entry<'_, K, V>>
[src]
Returns the entry with the largest key.
pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
Q: Ord,
Returns true
if the map contains a value for the specified key.
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<Entry<'_, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
Q: Ord,
Returns an entry with the specified key
.
pub fn lower_bound<'a, Q: ?Sized>(
&'a self,
bound: Bound<&Q>
) -> Option<Entry<'a, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
&'a self,
bound: Bound<&Q>
) -> Option<Entry<'a, K, V>> where
K: Borrow<Q>,
Q: Ord,
Returns an Entry
pointing to the lowest element whose key is above
the given bound. If no such element is found then None
is
returned.
pub fn upper_bound<'a, Q: ?Sized>(
&'a self,
bound: Bound<&Q>
) -> Option<Entry<'a, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
&'a self,
bound: Bound<&Q>
) -> Option<Entry<'a, K, V>> where
K: Borrow<Q>,
Q: Ord,
Returns an Entry
pointing to the highest element whose key is below
the given bound. If no such element is found then None
is
returned.
pub fn get_or_insert(&self, key: K, value: V) -> Entry<'_, K, V>
[src]
Finds an entry with the specified key, or inserts a new key
-value
pair if none exist.
pub fn iter(&self) -> Iter<'_, K, V>ⓘ
[src]
Returns an iterator over all entries in the map.
pub fn range<Q: ?Sized, R>(&self, range: R) -> Range<'_, Q, R, K, V>ⓘ where
K: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
Returns an iterator over a subset of entries in the skip list.
impl<K, V> SkipMap<K, V> where
K: Ord + Send + 'static,
V: Send + 'static,
[src]
impl<K, V> SkipMap<K, V> where
K: Ord + Send + 'static,
V: Send + 'static,
[src]pub fn insert(&self, key: K, value: V) -> Entry<'_, K, V>
[src]
Inserts a key
-value
pair into the map and returns the new entry.
If there is an existing entry with this key, it will be removed before inserting the new one.
pub fn remove<Q: ?Sized>(&self, key: &Q) -> Option<Entry<'_, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
Q: Ord,
Removes an entry with the specified key
from the map and returns it.
pub fn pop_front(&self) -> Option<Entry<'_, K, V>>
[src]
Removes an entry from the front of the map.
pub fn pop_back(&self) -> Option<Entry<'_, K, V>>
[src]
Removes an entry from the back of the map.
pub fn clear(&self)
[src]
Iterates over the map and removes every entry.
Trait Implementations
impl<K, V> IntoIterator for SkipMap<K, V>
[src]
impl<K, V> IntoIterator for SkipMap<K, V>
[src]Auto Trait Implementations
impl<K, V> !RefUnwindSafe for SkipMap<K, V>
impl<K, V> Send for SkipMap<K, V> where
K: Send + Sync,
V: Send + Sync,
K: Send + Sync,
V: Send + Sync,
impl<K, V> Sync for SkipMap<K, V> where
K: Send + Sync,
V: Send + Sync,
K: Send + Sync,
V: Send + Sync,