[][src]Struct idmap::set::IdSet

pub struct IdSet<T: IntegerId> { /* fields omitted */ }

A set, whose implement IntegerId

This is implemented directly as a bitset, so it may not be appropriate if you know you'll have large ids but few entries.

Implementations

impl<T: IntegerId> IdSet<T>[src]

pub fn new() -> IdSet<T>[src]

Create a new IdSet

pub fn with_capacity(indexes: usize) -> IdSet<T>[src]

Initialize the set with the given capacity

Since the underlying storage is a simple bitset, this hints at the maximum capacity and not the length

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

Inserts the specified element into the set, returning true if it was already in the set and false if it wasn't.

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

Remove the specified value from the set if it is present, returning whether or not it was present.

pub fn contains<Q: Borrow<T>>(&self, value: Q) -> bool[src]

Check if this set contains the specified value

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

Iterate over the values in this set

pub fn clear(&mut self)[src]

Clear the values in this set

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

The number of entries in this set

An IdSet internally tracks this length, so this is a O(1) operation

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

If this set is empty

pub fn retain<F: FnMut(&T) -> bool>(&mut self, func: F)[src]

Retain values in the set if the specified closure returns true

Otherwise they are removed

Trait Implementations

impl<T: Clone + IntegerId> Clone for IdSet<T>[src]

impl<T: IntegerId> Debug for IdSet<T>[src]

impl<T: IntegerId> Default for IdSet<T>[src]

impl<'de, T> Deserialize<'de> for IdSet<T> where
    T: IntegerId + Deserialize<'de>, 
[src]

impl<T: IntegerId + Eq> Eq for IdSet<T>[src]

impl<'a, T: IntegerId + 'a> Extend<&'a T> for IdSet<T>[src]

impl<T: IntegerId> Extend<T> for IdSet<T>[src]

impl<'a, T: IntegerId + 'a> FromIterator<&'a T> for IdSet<T>[src]

impl<T: IntegerId> FromIterator<T> for IdSet<T>[src]

impl<T: IntegerId + Hash> Hash for IdSet<T>[src]

impl<'a, T: IntegerId + 'a> Index<&'a T> for IdSet<T>[src]

type Output = bool

The returned type after indexing.

impl<'a, T: IntegerId + 'a> Index<T> for IdSet<T>[src]

type Output = bool

The returned type after indexing.

impl<'a, T: IntegerId + 'a> IntoIterator for &'a IdSet<T>[src]

type Item = 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: IntegerId + Ord> Ord for IdSet<T>[src]

impl<T: IntegerId + PartialEq> PartialEq<IdSet<T>> for IdSet<T>[src]

impl<T: IntegerId + PartialOrd> PartialOrd<IdSet<T>> for IdSet<T>[src]

impl<T> Serialize for IdSet<T> where
    T: IntegerId + Serialize
[src]

impl<T: IntegerId> VisitMap<T> for IdSet<T>[src]

Auto Trait Implementations

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

impl<T> Send for IdSet<T> where
    T: Send

impl<T> Sync for IdSet<T> where
    T: Sync

impl<T> Unpin for IdSet<T> where
    T: Unpin

impl<T> UnwindSafe for IdSet<T> where
    T: UnwindSafe

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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.