[][src]Struct avl::AvlTreeSet

pub struct AvlTreeSet<T> { /* fields omitted */ }

A sorted set implemented with a nearly balanced binary search tree.

Implementations

impl<T: Ord> Set<T>[src]

pub fn new() -> Self[src]

Creates an empty set. No memory is allocated until the first item is inserted.

impl<T: Ord> Set<T>[src]

pub fn get(&self, value: &T) -> Option<&T>[src]

Returns a reference to the value in the set that is equal to the given value.

pub fn insert(&mut self, value: T) -> bool[src]

Inserts a value into the set.

pub fn remove(&mut self, value: &T) -> bool[src]

Removes a value from the set. Returns whether the value was previously in the set.

pub fn take(&mut self, value: &T) -> Option<T>[src]

Removes a value from the set. Returns the value if it was previously in the set.

impl<T> Set<T>[src]

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

Returns true if the set contains no elements.

pub fn len(&self) -> usize[src]

Returns the number of elements in the set.

pub fn clear(&mut self)[src]

Clears the set, deallocating all memory.

pub fn iter<'a>(&'a self) -> Iter<'a, T>[src]

Gets an iterator over the values of the map in sorted order.

Trait Implementations

impl<T: Debug> Debug for Set<T>[src]

impl<T: Ord> Default for Set<T>[src]

fn default() -> Self[src]

Creates an empty set.

impl<'a, T> IntoIterator for &'a Set<T>[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> IntoIterator for Set<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<T> RefUnwindSafe for Set<T> where
    T: RefUnwindSafe

impl<T> !Send for Set<T>

impl<T> !Sync for Set<T>

impl<T> Unpin for Set<T>

impl<T> UnwindSafe for Set<T> where
    T: RefUnwindSafe

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> From<T> for T[src]

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.