[][src]Trait bevy_utils::AHashExt

pub trait AHashExt {
    pub fn new() -> Self;
pub fn with_capacity(capacity: usize) -> Self; }

Required methods

pub fn new() -> Self[src]

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

Loading content...

Implementors

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);

impl<K, V> AHashExt for HashMap<K, V>[src]

pub fn new() -> Self[src]

Creates an empty HashMap with AHash.

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

Examples

use bevy_utils::{HashMap, AHashExt};
let mut map: HashMap<&str, i32> = HashMap::new();

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

Creates an empty HashMap with the specified capacity with AHash.

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

Examples

use bevy_utils::{HashMap, AHashExt};
let mut map: HashMap<&str, i32> = HashMap::with_capacity(10);
Loading content...