Struct crossbeam_skiplist::SkipSet [−][src]
pub struct SkipSet<T> { /* fields omitted */ }
A set based on a lock-free skip list.
Implementations
impl<T> SkipSet<T>
[src]
impl<T> SkipSet<T>
[src]pub fn new() -> SkipSet<T>
[src]
Returns a new, empty set.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the set is empty.
pub fn len(&self) -> usize
[src]
Returns the number of entries in the set.
If the set is being concurrently modified, consider the returned number just an approximation without any guarantees.
impl<T> SkipSet<T> where
T: Ord,
[src]
impl<T> SkipSet<T> where
T: Ord,
[src]pub fn front(&self) -> Option<Entry<'_, T>>
[src]
Returns the entry with the smallest key.
pub fn back(&self) -> Option<Entry<'_, T>>
[src]
Returns the entry with the largest key.
pub fn contains<Q: ?Sized>(&self, key: &Q) -> bool where
T: Borrow<Q>,
Q: Ord,
[src]
T: Borrow<Q>,
Q: Ord,
Returns true
if the set contains a value for the specified key.
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<Entry<'_, T>> where
T: Borrow<Q>,
Q: Ord,
[src]
T: 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, T>> where
T: Borrow<Q>,
Q: Ord,
[src]
&'a self,
bound: Bound<&Q>
) -> Option<Entry<'a, T>> where
T: 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, T>> where
T: Borrow<Q>,
Q: Ord,
[src]
&'a self,
bound: Bound<&Q>
) -> Option<Entry<'a, T>> where
T: 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: T) -> Entry<'_, T>
[src]
Finds an entry with the specified key, or inserts a new key
-value
pair if none exist.
pub fn iter(&self) -> Iter<'_, T>ⓘ
[src]
Returns an iterator over all entries in the map.
pub fn range<Q: ?Sized, R>(&self, range: R) -> Range<'_, Q, R, T>ⓘ where
T: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
[src]
T: Borrow<Q>,
R: RangeBounds<Q>,
Q: Ord,
Returns an iterator over a subset of entries in the skip list.
impl<T> SkipSet<T> where
T: Ord + Send + 'static,
[src]
impl<T> SkipSet<T> where
T: Ord + Send + 'static,
[src]pub fn insert(&self, key: T) -> Entry<'_, T>
[src]
Inserts a key
-value
pair into the set 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<'_, T>> where
T: Borrow<Q>,
Q: Ord,
[src]
T: Borrow<Q>,
Q: Ord,
Removes an entry with the specified key from the set and returns it.
pub fn pop_front(&self) -> Option<Entry<'_, T>>
[src]
Removes an entry from the front of the map.
pub fn pop_back(&self) -> Option<Entry<'_, T>>
[src]
Removes an entry from the back of the map.
pub fn clear(&self)
[src]
Iterates over the set and removes every entry.
Trait Implementations
impl<T> FromIterator<T> for SkipSet<T> where
T: Ord,
[src]
impl<T> FromIterator<T> for SkipSet<T> where
T: Ord,
[src]fn from_iter<I>(iter: I) -> SkipSet<T> where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
impl<T> IntoIterator for SkipSet<T>
[src]
impl<T> IntoIterator for SkipSet<T>
[src]impl<'a, T> IntoIterator for &'a SkipSet<T> where
T: Ord,
[src]
impl<'a, T> IntoIterator for &'a SkipSet<T> where
T: Ord,
[src]Auto Trait Implementations
impl<T> !RefUnwindSafe for SkipSet<T>
impl<T> Send for SkipSet<T> where
T: Send + Sync,
T: Send + Sync,
impl<T> Sync for SkipSet<T> where
T: Send + Sync,
T: Send + Sync,