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

pub struct RedBlackTreeSet<T> where
    T: Ord
{ /* fields omitted */ }

A persistent set with structural sharing. This implementation uses a red-black tree and supports fast insert(), remove(), and contains().

Complexity

Let n be the number of elements in the set.

Temporal complexity

Operation Best case Average Worst case
new() Θ(1) Θ(1) Θ(1)
insert() Θ(1) Θ(log(n)) Θ(log(n))
remove() Θ(1) Θ(log(n)) Θ(log(n))
get() Θ(1) Θ(log(n)) Θ(log(n))
contains() Θ(1) Θ(log(n)) Θ(log(n))
size() Θ(1) Θ(1) Θ(1)
clone() Θ(1) Θ(1) Θ(1)
iterator creation Θ(1) Θ(1) Θ(1)
iterator step Θ(1) Θ(1) Θ(log(n))
iterator full Θ(n) Θ(n) Θ(n)

Implementation details

This is a thin wrapper around a RedBlackTreeMap.

Methods

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

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Trait Implementations

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

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Returns the "default value" for a type. Read more

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

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

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

[src]

Formats the value using the given formatter. Read more

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

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

[src]

Creates a value from an iterator. Read more

Auto Trait Implementations

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

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