HashSet::with_capacity
pub static fn with_capacity(int cap) -> HashSet<T> Import
Source: use collections::set::{HashSet}; src/collections/set.hy Create a set with bucket count rounded up to the next power of two (min 8).
Parameters#
| Name | Type |
|---|---|
cap | int |
Returns#
HashSet<T>
See also#
HashSet: A set of unique values.HashSet::new: Empty set with default capacity 8.HashSet::size: Number of elements.HashSet::is_empty: Returnstruewhen the set has no values.HashSet::clear: Remove all elements.HashSet::insert: Insertx; returnstruewhen newly added.HashSet::contains: True whenxis present.HashSet::remove: Removex; returnstruewhen an element was removed.