Struct concread::hashmap::HashMap[][src]

pub struct HashMap<K, V> where
    K: Hash + Eq + Clone + Debug + Sync + Send + 'static,
    V: Clone + Sync + Send + 'static, 
{ /* fields omitted */ }
Expand description

A concurrently readable map based on a modified B+Tree structured with fast parallel hashed key lookup.

This structure can be used in locations where you would otherwise us RwLock<HashMap> or Mutex<HashMap>.

This is a concurrently readable structure, meaning it has transactional properties. Writers are serialised (one after the other), and readers can exist in parallel with stable views of the structure at a point in time.

This is achieved through the use of COW or MVCC. As a write occurs subsets of the tree are cloned into the writer thread and then commited later. This may cause memory usage to increase in exchange for a gain in concurrent behaviour.

Transactions can be rolled-back (aborted) without penalty by dropping the HashMapWriteTxn without calling commit().

Implementations

Construct a new concurrent hashmap

Initiate a read transaction for the Hashmap, concurrent to any other readers or writers.

Initiate a write transaction for the map, exclusive to this writer, and concurrently to all existing reads.

Attempt to create a new write, returns None if another writer already exists.

Trait Implementations

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

Creates a value from an iterator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.