[][src]Struct mycelium_experimental::SkipList

pub struct SkipList { /* fields omitted */ }

A lock-free skip list.

Methods

impl SkipList[src]

pub fn new(collector: Collector) -> SkipList[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 SkipList[src]

pub fn front<'a>(&'a self, guard: &'a Guard) -> Option<Entry>[src]

Returns the entry with the smallest key.

pub fn back<'a>(&'a self, guard: &'a Guard) -> Option<Entry<'a>>[src]

Returns the entry with the largest key.

pub fn contains_key(&self, key: [u8; 16], guard: &Guard) -> bool[src]

Returns true if the map contains a value for the specified key.

pub fn get<'a>(&'a self, key: [u8; 16], guard: &'a Guard) -> Option<Entry>[src]

Returns an entry with the specified key.

pub fn lower_bound<'a>(
    &'a self,
    bound: Bound<[u8; 16]>,
    guard: &'a Guard
) -> Option<Entry<'a>>
[src]

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>(
    &'a self,
    bound: Bound<[u8; 16]>,
    guard: &'a Guard
) -> Option<Entry<'a>>
[src]

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: [u8; 16],
    value: Vec<u8>,
    guard: &Guard
) -> RefEntry
[src]

Finds an entry with the specified key, or inserts a new key-value pair if none exist.

Important traits for Iter<'a, 'a>
pub fn iter<'a: 'g, 'g>(&'a self, guard: &'g Guard) -> Iter<'a, 'g>[src]

Returns an iterator over all entries in the skip list.

pub fn ref_iter(&self) -> RefIter[src]

Returns an iterator over all entries in the skip list.

impl SkipList[src]

pub fn insert(&self, key: [u8; 16], value: Vec<u8>, guard: &Guard) -> RefEntry[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(&self, key: [u8; 16], guard: &Guard) -> Option<RefEntry>[src]

Removes an entry with the specified key from the map and returns it.

pub fn pop_front<'a>(&'a self, guard: &'a Guard) -> Option<RefEntry<'a>>[src]

Removes an entry from the front of the skip list.

pub fn pop_back<'a>(&'a self, guard: &'a Guard) -> Option<RefEntry<'a>>[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 Send for SkipList[src]

impl Sync for SkipList[src]

impl Drop for SkipList[src]

impl IntoIterator for SkipList[src]

type Item = ([u8; 16], Vec<u8>)

The type of the elements being iterated over.

type IntoIter = IntoIter

Which kind of iterator are we turning this into?

impl Debug for SkipList[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]