[][src]Type Definition bevy_utils::HashSet

type HashSet<K> = HashSet<K, RandomState>;

A std hash set implementing AHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps.

AHash is designed for performance and is NOT cryptographically secure.

Trait Implementations

impl<K> AHashExt for HashSet<K>[src]

pub fn new() -> Self[src]

Creates an empty HashSet with AHash.

The hash set is initially created with a capacity of 0, so it will not allocate until it is first inserted into.

Examples

use bevy_utils::{HashSet, AHashExt};
let set: HashSet<i32> = HashSet::new();

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

Creates an empty HashSet with the specified capacity with AHash.

The hash set will be able to hold at least capacity elements without reallocating. If capacity is 0, the hash set will not allocate.

Examples

use bevy_utils::{HashSet, AHashExt};
let set: HashSet<i32> = HashSet::with_capacity(10);
assert!(set.capacity() >= 10);