[][src]Struct logmap::OptiMap

pub struct OptiMap<K, V, S> where
    K: PartialEq + Hash,
    S: BuildHasher
{ /* fields omitted */ }

A concurrent HashMap that uses optimistic concurrency control (hence the name)

Methods

impl<K, V> OptiMap<K, V, RandomState> where
    K: PartialEq + Hash
[src]

pub fn new() -> Self[src]

Creates a new OptiMap with default number of buckets and hasher

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

Creates a new OptiMap with cap buckets

impl<K, V, S> OptiMap<K, V, S> where
    K: PartialEq + Hash,
    S: BuildHasher
[src]

pub fn with_hasher(hasher: S) -> Self[src]

Create a new OptiMap that uses the given hasher for hashing keys

pub fn with_capacity_and_hasher(cap: usize, hasher: S) -> Self[src]

Creates a new OptiMap with cap collision bucket and the given Hasher

pub fn get(&self, key: &K) -> Option<ValueHolder<K, V>>[src]

Gets the value associated with the given key if it exists

pub fn contains(&self, key: &K) -> bool[src]

Checks if the map contains a given key

pub fn put(&self, key: K, value: V)[src]

Insert a new entry in the OptiMap. Note that the map takes ownership of both the key and the value

pub fn delete(&self, key: &K)[src]

Auto Trait Implementations

impl<K, V, S> Send for OptiMap<K, V, S> where
    S: Send

impl<K, V, S> Unpin for OptiMap<K, V, S> where
    S: Unpin

impl<K, V, S> Sync for OptiMap<K, V, S> where
    S: Sync

impl<K, V, S> UnwindSafe for OptiMap<K, V, S> where
    S: UnwindSafe

impl<K, V, S> RefUnwindSafe for OptiMap<K, V, S> where
    S: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]