Trait eclectic::set::Insert [] [src]

pub trait Insert: Set + Insert {
    fn insert(&mut self, item: Self::Item) -> bool;
    fn replace(&mut self, item: Self::Item) -> Option<Self::Item>;
}

A set that supports insertion.

Required Methods

fn insert(&mut self, item: Self::Item) -> bool

Inserts the given item into the set without replacing an equivalent item.

Returns true if the set did not contain an equivalent item, false otherwise.

fn replace(&mut self, item: Self::Item) -> Option<Self::Item>

Inserts the given item into the set, replacing an equivalent item.

Returns the equivalent item if the set contained one, None otherwise.

Implementors