Struct idmap::set::IdSet [−][src]
pub struct IdSet<T: IntegerId> { /* fields omitted */ }
Methods
impl<T: IntegerId> IdSet<T>
[src]
impl<T: IntegerId> IdSet<T>
pub fn new() -> IdSet<T>
[src]
pub fn new() -> IdSet<T>
pub fn with_capacity(indexes: usize) -> IdSet<T>
[src]
pub fn with_capacity(indexes: usize) -> IdSet<T>
pub fn insert<Q: Borrow<T>>(&mut self, value: Q) -> bool
[src]
pub fn insert<Q: Borrow<T>>(&mut self, value: Q) -> bool
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]
pub fn remove<Q: Borrow<T>>(&mut self, value: Q) -> bool
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]
pub fn contains<Q: Borrow<T>>(&self, value: Q) -> bool
Check if this set contains the specified value
ⓘImportant traits for Iter<'a, T>pub fn iter(&self) -> Iter<T>
[src]
pub fn iter(&self) -> Iter<T>
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
pub fn retain<F: FnMut(&T) -> bool>(&mut self, func: F)
[src]
pub fn retain<F: FnMut(&T) -> bool>(&mut self, func: F)
Trait Implementations
impl<T: Clone + IntegerId> Clone for IdSet<T>
[src]
impl<T: Clone + IntegerId> Clone for IdSet<T>
fn clone(&self) -> IdSet<T>
[src]
fn clone(&self) -> IdSet<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: IntegerId> Default for IdSet<T>
[src]
impl<T: IntegerId> Default for IdSet<T>
impl<T: IntegerId + PartialEq> PartialEq for IdSet<T>
[src]
impl<T: IntegerId + PartialEq> PartialEq for IdSet<T>
fn eq(&self, other: &IdSet<T>) -> bool
[src]
fn eq(&self, other: &IdSet<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T: IntegerId + Eq> Eq for IdSet<T>
[src]
impl<T: IntegerId + Eq> Eq for IdSet<T>
impl<T: IntegerId> Debug for IdSet<T>
[src]
impl<T: IntegerId> Debug for IdSet<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, T: IntegerId + 'a> Extend<&'a T> for IdSet<T>
[src]
impl<'a, T: IntegerId + 'a> Extend<&'a T> for IdSet<T>
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<T: IntegerId> Extend<T> for IdSet<T>
[src]
impl<T: IntegerId> Extend<T> for IdSet<T>
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<T: IntegerId> FromIterator<T> for IdSet<T>
[src]
impl<T: IntegerId> FromIterator<T> for IdSet<T>
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl<'a, T: IntegerId + 'a> FromIterator<&'a T> for IdSet<T>
[src]
impl<'a, T: IntegerId + 'a> FromIterator<&'a T> for IdSet<T>
fn from_iter<I: IntoIterator<Item = &'a T>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = &'a T>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl<'a, T: IntegerId + 'a> IntoIterator for &'a IdSet<T>
[src]
impl<'a, T: IntegerId + 'a> IntoIterator for &'a IdSet<T>
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?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a, T: IntegerId + 'a> Index<&'a T> for IdSet<T>
[src]
impl<'a, T: IntegerId + 'a> Index<&'a T> for IdSet<T>
type Output = bool
The returned type after indexing.
fn index(&self, index: &'a T) -> &Self::Output
[src]
fn index(&self, index: &'a T) -> &Self::Output
Performs the indexing (container[index]
) operation.
impl<'a, T: IntegerId + 'a> Index<T> for IdSet<T>
[src]
impl<'a, T: IntegerId + 'a> Index<T> for IdSet<T>
type Output = bool
The returned type after indexing.
fn index(&self, index: T) -> &Self::Output
[src]
fn index(&self, index: T) -> &Self::Output
Performs the indexing (container[index]
) operation.
impl<T: IntegerId + Hash> Hash for IdSet<T>
[src]
impl<T: IntegerId + Hash> Hash for IdSet<T>
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: IntegerId + PartialOrd> PartialOrd for IdSet<T>
[src]
impl<T: IntegerId + PartialOrd> PartialOrd for IdSet<T>
fn partial_cmp(&self, other: &IdSet<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &IdSet<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: IntegerId + Ord> Ord for IdSet<T>
[src]
impl<T: IntegerId + Ord> Ord for IdSet<T>
fn cmp(&self, other: &IdSet<T>) -> Ordering
[src]
fn cmp(&self, other: &IdSet<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<'de, T> Deserialize<'de> for IdSet<T> where
T: IntegerId + Deserialize<'de>,
[src]
impl<'de, T> Deserialize<'de> for IdSet<T> where
T: IntegerId + Deserialize<'de>,
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<T> Serialize for IdSet<T> where
T: IntegerId + Serialize,
[src]
impl<T> Serialize for IdSet<T> where
T: IntegerId + Serialize,
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
[src]
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
Serialize this value into the given Serde serializer. Read more
impl<T: IntegerId> VisitMap<T> for IdSet<T>
[src]
impl<T: IntegerId> VisitMap<T> for IdSet<T>