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

pub struct RedBlackTreeSet<T> where
    T: Ord
{ /* 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

Operation Average Worst 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.

Methods

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

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

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

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

#[must_use]
pub fn remove<V: ?Sized>(&self, v: &V) -> RedBlackTreeSet<T> 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(&self, other: &RedBlackTreeSet<T>) -> bool
[src]

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

#[must_use]
pub fn is_superset(&self, other: &RedBlackTreeSet<T>) -> bool
[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>
[src]

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

Trait Implementations

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

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

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

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

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

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

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

Auto Trait Implementations

impl<T> Send for RedBlackTreeSet<T> where
    T: Send + Sync

impl<T> Sync for RedBlackTreeSet<T> where
    T: Send + Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Owned = T

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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