Options

Struct Options 

Source
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,

Source

pub fn with_meta<M2>(self, meta: M2) -> Options<M2, S>

Set the initial meta value for the map.

Source

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.

Source

pub fn with_capacity(self, capacity: usize) -> Options<M, S>

Set the initial capacity for the map.

Source

pub fn construct<K, V>( self, ) -> (WriteHandle<K, V, M, S>, ReadHandle<K, V, M, S>)
where K: StableHashEq + Clone, S: BuildHasher + Clone, V: StableHashEq, M: 'static + Clone,

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.

Source

pub unsafe fn assert_stable<K, V>( self, ) -> (WriteHandle<K, V, M, S>, ReadHandle<K, V, M, S>)
where K: Eq + Hash + Clone, S: BuildHasher + Clone, V: Eq + Hash, M: 'static + Clone,

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.

Trait Implementations§

Source§

impl<M, S> Debug for Options<M, S>
where S: BuildHasher, M: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Options<(), RandomState>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<M, S> Freeze for Options<M, S>
where M: Freeze, S: Freeze,

§

impl<M, S> RefUnwindSafe for Options<M, S>

§

impl<M, S> Send for Options<M, S>
where M: Send, S: Send,

§

impl<M, S> Sync for Options<M, S>
where M: Sync, S: Sync,

§

impl<M, S> Unpin for Options<M, S>
where M: Unpin, S: Unpin,

§

impl<M, S> UnwindSafe for Options<M, S>
where M: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V