[][src]Struct oasis_std::collections::set::Set

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

Set is a data structure with a Set-like API but based on a Vec. It's primarily useful when you care about constant factors or prefer determinism to speed. Please refer to the docs for Set for details and examples of the Set API.

Example

use oasis_std::collections::Set;
let mut set1 = Set::new();
let mut set2 = Set::new();
set1.insert(1);
set1.insert(2);
set2.insert(2);
set2.insert(3);
let mut set3 = Set::with_capacity(1);
assert!(set3.insert(3));
assert_eq!(&set2 - &set1, set3);

Methods

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

pub fn new() -> Self[src]

pub fn with_capacity(capacity: usize) -> Self[src]

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

pub fn clear(&mut self)[src]

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

pub fn difference<'a>(
    &'a self,
    other: &'a Self
) -> impl Iterator<Item = &'a T> + DoubleEndedIterator
[src]

pub fn drain(&mut self) -> Drain<T>[src]

pub fn get<Q: ?Sized>(&self, value: &Q) -> Option<&T> where
    T: Borrow<Q>,
    Q: Eq
[src]

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

pub fn get_or_insert_with<Q: ?Sized>(
    &mut self,
    value: &Q,
    f: impl FnOnce(&Q) -> T
) -> &T where
    T: Borrow<Q>,
    Q: Eq
[src]

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

pub fn intersection<'a>(
    &'a self,
    other: &'a Self
) -> impl Iterator<Item = &'a T> + DoubleEndedIterator<Item = &'a T>
[src]

pub fn is_disjoint<'a>(&'a self, other: &'a Self) -> bool[src]

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

pub fn is_subset(&self, other: &Self) -> bool[src]

pub fn is_superset(&self, other: &Self) -> bool[src]

pub fn iter(
    &self
) -> impl Iterator<Item = &T> + DoubleEndedIterator + ExactSizeIterator
[src]

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

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

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

pub fn reserve(&mut self, additional: usize)[src]

pub fn retain(&mut self, f: impl FnMut(&T) -> bool)[src]

pub fn shrink_to(&mut self, min_capacity: usize)[src]

pub fn shrink_to_fit(&mut self)[src]

pub fn symmetric_difference<'a>(
    &'a self,
    other: &'a Self
) -> impl Iterator<Item = &'a T> + DoubleEndedIterator
[src]

pub fn take<Q: ?Sized>(&mut self, value: &Q) -> Option<T> where
    T: Borrow<Q>,
    Q: Eq
[src]

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>[src]

pub fn union<'a>(
    &'a self,
    other: &'a Self
) -> impl Iterator<Item = &'a T> + DoubleEndedIterator
[src]

Trait Implementations

impl<'_, '_, T: Clone + Eq> BitAnd<&'_ Set<T>> for &'_ Set<T>[src]

type Output = Set<T>

The resulting type after applying the & operator.

impl<'_, '_, T: Clone + Eq> BitOr<&'_ Set<T>> for &'_ Set<T>[src]

type Output = Set<T>

The resulting type after applying the | operator.

impl<'_, '_, T: Clone + Eq> BitXor<&'_ Set<T>> for &'_ Set<T>[src]

type Output = Set<T>

The resulting type after applying the ^ operator.

impl<T> BorshDeserialize for Set<T> where
    T: BorshDeserialize + Eq
[src]

impl<T> BorshSerialize for Set<T> where
    T: BorshSerialize + PartialOrd
[src]

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

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

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

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

impl<'a, T: 'a + Copy + Eq> Extend<&'a T> for Set<T>[src]

impl<T: Eq> Extend<T> for Set<T>[src]

impl<T: Eq> FromIterator<T> for Set<T>[src]

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?

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

impl<T> StructuralEq for Set<T>[src]

impl<T> StructuralPartialEq for Set<T>[src]

impl<'_, '_, T: Clone + Eq> Sub<&'_ Set<T>> for &'_ Set<T>[src]

type Output = Set<T>

The resulting type after applying the - operator.

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Set<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<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<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> 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.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,