pub struct Options<M, S>where
S: BuildHasher,{ /* private fields */ }Expand description
Options for how to initialize the map.
In particular, the options dictate the hashing function, meta type, and initial capacity of the map.
Implementations§
Source§impl<M, S> Options<M, S>where
S: BuildHasher,
impl<M, S> Options<M, S>where
S: BuildHasher,
Sourcepub unsafe fn with_hasher<S2>(self, hash_builder: S2) -> Options<M, S2>where
S2: BuildHasher + Clone,
pub unsafe fn with_hasher<S2>(self, hash_builder: S2) -> Options<M, S2>where
S2: BuildHasher + Clone,
Set the hasher used for the map.
§Safety
This method is safe to call as long as the given hasher is deterministic. That is, it must yield the same hash if given the same sequence of inputs.
Sourcepub fn with_capacity(self, capacity: usize) -> Options<M, S>
pub fn with_capacity(self, capacity: usize) -> Options<M, S>
Set the initial capacity for the map.
Sourcepub fn construct<K, V>(
self,
) -> (WriteHandle<K, V, M, S>, ReadHandle<K, V, M, S>)
pub fn construct<K, V>( self, ) -> (WriteHandle<K, V, M, S>, ReadHandle<K, V, M, S>)
Create the map, and construct the read and write handles used to access it.
If you want to use arbitrary types for the keys and values, use assert_stable.
Sourcepub unsafe fn assert_stable<K, V>(
self,
) -> (WriteHandle<K, V, M, S>, ReadHandle<K, V, M, S>)
pub unsafe fn assert_stable<K, V>( self, ) -> (WriteHandle<K, V, M, S>, ReadHandle<K, V, M, S>)
Create the map, and construct the read and write handles used to access it.
§Safety
This method is safe to call as long as the implementation of Hash and Eq for both K
and V are deterministic. That is, they must always yield the same result if given the
same inputs. For keys of type K, the result must also be consistent between different clones
of the same key.