pub struct Multiset<T, S = DeterministicHasherBuilder> { /* private fields */ }
Expand description
Multi-set of values.
Implementations§
Source§impl<T, S> Multiset<T, S>
impl<T, S> Multiset<T, S>
pub fn new() -> Selfwhere
S: Default,
pub fn with_capacity(cap: usize) -> Selfwhere
S: Default,
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, value: &T) -> boolwhere
T: PartialEq,
pub fn iter(&self) -> Iter<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn as_slice(&self) -> &[T]
Trait Implementations§
Source§impl<T: Hash, S: BuildHasher> Extend<T> for Multiset<T, S>
impl<T: Hash, S: BuildHasher> Extend<T> for Multiset<T, S>
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T: Hash, S: Default + BuildHasher> FromIterator<T> for Multiset<T, S>
impl<T: Hash, S: Default + BuildHasher> FromIterator<T> for Multiset<T, S>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T, S> IntoIterator for &'a Multiset<T, S>
impl<'a, T, S> IntoIterator for &'a Multiset<T, S>
Source§impl<'a, T, S> IntoIterator for &'a mut Multiset<T, S>
impl<'a, T, S> IntoIterator for &'a mut Multiset<T, S>
Source§impl<T, S> IntoIterator for Multiset<T, S>
impl<T, S> IntoIterator for Multiset<T, S>
Source§impl<T: IntoJsonWithContext<N>, S, N> IntoJsonWithContext<N> for Multiset<T, S>
impl<T: IntoJsonWithContext<N>, S, N> IntoJsonWithContext<N> for Multiset<T, S>
fn into_json_with(self, vocabulary: &N) -> Value
impl<T: Eq, S> Eq for Multiset<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for Multiset<T, S>where
S: Freeze,
impl<T, S> RefUnwindSafe for Multiset<T, S>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for Multiset<T, S>
impl<T, S> Sync for Multiset<T, S>
impl<T, S> Unpin for Multiset<T, S>
impl<T, S> UnwindSafe for Multiset<T, S>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.