Struct SkipList

Source
pub struct SkipList<T> { /* private fields */ }

Implementations§

Source§

impl<T: Ord> SkipList<T>

Source

pub fn new() -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn locate<Q>(&self, key: &Q) -> Option<usize>
where Q: Ord + ?Sized, T: Borrow<Q>,

Source

pub fn contains<Q>(&self, key: &Q) -> bool
where Q: Ord + ?Sized, T: Borrow<Q>,

Source

pub fn insert(&mut self, value: T)
where T: Ord,

Source

pub fn remove<Q>(&mut self, key: &Q) -> Option<T>
where Q: Ord + ?Sized, T: Borrow<Q>,

Removes and returns the value for a given key, if it exists in the list.

Source

pub fn get_kth(&self, k: usize) -> Option<&T>

Returns the Kth value in the list, if it exists.

Source

pub fn range<Q, R>(&self, range: R) -> RangeIter<'_, T, Q, R>
where Q: Ord + ?Sized, T: Borrow<Q>, R: RangeBounds<Q>,

Returns an inclusive iterator over a range of values in the list from start to end.

Source

pub fn iter(&self) -> Iter<'_, T>

Trait Implementations§

Source§

impl<T: Ord> Default for SkipList<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, T: Ord> IntoIterator for &'a SkipList<T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SkipList<T>

§

impl<T> RefUnwindSafe for SkipList<T>
where T: RefUnwindSafe,

§

impl<T> Send for SkipList<T>
where T: Send,

§

impl<T> Sync for SkipList<T>
where T: Sync,

§

impl<T> Unpin for SkipList<T>
where T: Unpin,

§

impl<T> UnwindSafe for SkipList<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V