Struct rpds::set::red_black_tree_set::RedBlackTreeSet[][src]

pub struct RedBlackTreeSet<T, P = RcK> where
    T: Ord,
    P: SharedPointerKind
{ /* fields omitted */ }

A persistent set with structural sharing. This implementation uses a red-black tree.

Complexity

Let n be the number of elements in the set.

Temporal complexity

OperationAverageWorst case
new()Θ(1)Θ(1)
insert()Θ(log(n))Θ(log(n))
remove()Θ(log(n))Θ(log(n))
get()Θ(log(n))Θ(log(n))
contains()Θ(log(n))Θ(log(n))
size()Θ(1)Θ(1)
clone()Θ(1)Θ(1)
iterator creationΘ(log(n))Θ(log(n))
iterator stepΘ(1)Θ(log(n))
iterator fullΘ(n)Θ(n)

Implementation details

This is a thin wrapper around a RedBlackTreeMap.

Implementations

impl<T> RedBlackTreeSet<T, ArcK> where
    T: Ord
[src]

#[must_use]pub fn new_sync() -> RedBlackTreeSetSync<T>[src]

impl<T> RedBlackTreeSet<T> where
    T: Ord
[src]

#[must_use]pub fn new() -> RedBlackTreeSet<T>[src]

impl<T, P> RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

#[must_use]pub fn new_with_ptr_kind() -> RedBlackTreeSet<T, P>[src]

#[must_use]pub fn insert(&self, v: T) -> RedBlackTreeSet<T, P>[src]

pub fn insert_mut(&mut self, v: T)[src]

#[must_use]pub fn remove<V: ?Sized>(&self, v: &V) -> RedBlackTreeSet<T, P> where
    T: Borrow<V>,
    V: Ord
[src]

pub fn remove_mut<V: ?Sized>(&mut self, v: &V) -> bool where
    T: Borrow<V>,
    V: Ord
[src]

#[must_use]pub fn contains<V: ?Sized>(&self, v: &V) -> bool where
    T: Borrow<V>,
    V: Ord
[src]

#[must_use]pub fn first(&self) -> Option<&T>[src]

#[must_use]pub fn last(&self) -> Option<&T>[src]

#[must_use]pub fn is_disjoint<PO>(&self, other: &RedBlackTreeSet<T, PO>) -> bool where
    PO: SharedPointerKind
[src]

#[must_use]pub fn is_subset<PO>(&self, other: &RedBlackTreeSet<T, PO>) -> bool where
    PO: SharedPointerKind
[src]

#[must_use]pub fn is_superset<PO>(&self, other: &RedBlackTreeSet<T, PO>) -> bool where
    PO: SharedPointerKind
[src]

#[must_use]pub fn size(&self) -> usize[src]

#[must_use]pub fn is_empty(&self) -> bool[src]

#[must_use]pub fn iter(&self) -> Iter<'_, T, P>[src]

#[must_use]pub fn range<Q: ?Sized, RB>(&self, range: RB) -> RangeIter<'_, T, RB, Q, P> where
    T: Borrow<Q>,
    Q: Ord,
    RB: RangeBounds<Q>, 
[src]

Trait Implementations

impl<T, P> Clone for RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

impl<T: Debug, P: Debug> Debug for RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

impl<T, P> Default for RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

impl<'de, T, P> Deserialize<'de> for RedBlackTreeSet<T, P> where
    T: Ord + Deserialize<'de>,
    P: SharedPointerKind
[src]

impl<T, P> Display for RedBlackTreeSet<T, P> where
    T: Ord + Display,
    P: SharedPointerKind
[src]

impl<T, P> Eq for RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

impl<T, P> FromIterator<T> for RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

impl<'a, T, P> IntoIterator for &'a RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind
[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T, P>

Which kind of iterator are we turning this into?

impl<T: Ord, P> Ord for RedBlackTreeSet<T, P> where
    P: SharedPointerKind
[src]

impl<T, P, PO> PartialEq<RedBlackTreeSet<T, PO>> for RedBlackTreeSet<T, P> where
    T: Ord,
    P: SharedPointerKind,
    PO: SharedPointerKind
[src]

impl<T: Ord, P, PO> PartialOrd<RedBlackTreeSet<T, PO>> for RedBlackTreeSet<T, P> where
    P: SharedPointerKind,
    PO: SharedPointerKind
[src]

impl<T, P> Serialize for RedBlackTreeSet<T, P> where
    T: Ord + Serialize,
    P: SharedPointerKind
[src]

Auto Trait Implementations

impl<T, P> RefUnwindSafe for RedBlackTreeSet<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, P> Send for RedBlackTreeSet<T, P> where
    P: Send,
    T: Send

impl<T, P> Sync for RedBlackTreeSet<T, P> where
    P: Sync,
    T: Sync

impl<T, P> Unpin for RedBlackTreeSet<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> UnwindSafe for RedBlackTreeSet<T, P> where
    P: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.