pub struct Set<K> where
    K: Copy
{ /* private fields */ }
Expand description

B-tree representing an ordered set of Ks using C for comparing elements.

This is not a general-purpose replacement for BTreeSet. See the module documentation for more information about design tradeoffs.

Sets can be cloned, but that operation should only be used as part of cloning the whole forest they belong to. Cloning a set does not allocate new memory for the clone. It creates an alias of the same memory.

Implementations

Make an empty set.

Is this an empty set?

Does the set contain key?.

Try to insert key into the set.

If the set did not contain key, insert it and return true.

If key is already present, don’t change the set and return false.

Remove key from the set and return true.

If key was not present in the set, return false.

Remove all entries.

Retains only the elements specified by the predicate.

Remove all elements where the predicate returns false.

Create a cursor for navigating this set. The cursor is initially positioned off the end of the set.

Create an iterator traversing this set. The iterator type is K.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.