Struct crossbeam_skiplist::SkipList [−][src]
A lock-free skip list.
Implementations
impl<K, V> SkipList<K, V>
[src]
pub fn new(collector: Collector) -> SkipList<K, V>
[src]
Returns a new, empty skip list.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the skip list is empty.
pub fn len(&self) -> usize
[src]
Returns the number of entries in the skip list.
If the skip list is being concurrently modified, consider the returned number just an approximation without any guarantees.
impl<K, V> SkipList<K, V> where
K: Ord,
[src]
K: Ord,
pub fn front<'a: 'g, 'g>(
&'a self,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>>
[src]
&'a self,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>>
Returns the entry with the smallest key.
pub fn back<'a: 'g, 'g>(
&'a self,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>>
[src]
&'a self,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>>
Returns the entry with the largest key.
pub fn contains_key<Q: ?Sized>(&self, key: &Q, guard: &Guard) -> 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<'a: 'g, 'g, Q: ?Sized>(
&'a self,
key: &Q,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
&'a self,
key: &Q,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>> where
K: Borrow<Q>,
Q: Ord,
Returns an entry with the specified key
.
pub fn lower_bound<'a: 'g, 'g, Q: ?Sized>(
&'a self,
bound: Bound<&Q>,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
&'a self,
bound: Bound<&Q>,
guard: &'g Guard
) -> Option<Entry<'a, 'g, 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: 'g, 'g, Q: ?Sized>(
&'a self,
bound: Bound<&Q>,
guard: &'g Guard
) -> Option<Entry<'a, 'g, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
&'a self,
bound: Bound<&Q>,
guard: &'g Guard
) -> Option<Entry<'a, 'g, 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,
guard: &Guard
) -> RefEntry<'_, K, V>
[src]
&self,
key: K,
value: V,
guard: &Guard
) -> RefEntry<'_, K, V>
Finds an entry with the specified key, or inserts a new key
-value
pair if none exist.
pub fn iter<'a: 'g, 'g>(&'a self, guard: &'g Guard) -> Iter<'a, 'g, K, V>ⓘ
[src]
Returns an iterator over all entries in the skip list.
pub fn ref_iter(&self) -> RefIter<'_, K, V>
[src]
Returns an iterator over all entries in the skip list.
pub fn range<'a: 'g, 'g, Q: ?Sized, R>(
&'a self,
range: R,
guard: &'g Guard
) -> Range<'a, 'g, Q, R, K, V>ⓘ where
K: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
[src]
&'a self,
range: R,
guard: &'g Guard
) -> Range<'a, 'g, Q, R, K, V>ⓘ where
K: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
Returns an iterator over a subset of entries in the skip list.
pub fn ref_range<'a, Q: ?Sized, R>(
&'a self,
range: R
) -> RefRange<'a, Q, R, K, V> where
K: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
[src]
&'a self,
range: R
) -> RefRange<'a, Q, R, K, V> where
K: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
Returns an iterator over a subset of entries in the skip list.
impl<K, V> SkipList<K, V> where
K: Ord + Send + 'static,
V: Send + 'static,
[src]
K: Ord + Send + 'static,
V: Send + 'static,
pub fn insert(&self, key: K, value: V, guard: &Guard) -> RefEntry<'_, K, V>
[src]
Inserts a key
-value
pair into the skip list 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,
guard: &Guard
) -> Option<RefEntry<'_, K, V>> where
K: Borrow<Q>,
Q: Ord,
[src]
&self,
key: &Q,
guard: &Guard
) -> Option<RefEntry<'_, K, V>> where
K: Borrow<Q>,
Q: Ord,
Removes an entry with the specified key
from the map and returns it.
pub fn pop_front(&self, guard: &Guard) -> Option<RefEntry<'_, K, V>>
[src]
Removes an entry from the front of the skip list.
pub fn pop_back(&self, guard: &Guard) -> Option<RefEntry<'_, K, V>>
[src]
Removes an entry from the back of the skip list.
pub fn clear(&self, guard: &mut Guard)
[src]
Iterates over the map and removes every entry.
Trait Implementations
impl<K, V> Debug for SkipList<K, V> where
K: Ord + Debug,
V: Debug,
[src]
K: Ord + Debug,
V: Debug,
impl<K, V> Drop for SkipList<K, V>
[src]
impl<K, V> IntoIterator for SkipList<K, V>
[src]
type Item = (K, V)
The type of the elements being iterated over.
type IntoIter = IntoIter<K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> IntoIter<K, V>ⓘ
[src]
impl<K: Send + Sync, V: Send + Sync> Send for SkipList<K, V>
[src]
impl<K: Send + Sync, V: Send + Sync> Sync for SkipList<K, V>
[src]
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for SkipList<K, V>
impl<K, V> Unpin for SkipList<K, V>
impl<K, V> !UnwindSafe for SkipList<K, V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,