Struct evmap::ReadHandle [] [src]

pub struct ReadHandle<K, V, M = (), S = RandomState> where
    K: Eq + Hash,
    S: BuildHasher
{ /* fields omitted */ }

A handle that may be used to read from the eventually consistent map.

Note that any changes made to the map will not be made visible until the writer calls refresh(). In other words, all operations performed on a ReadHandle will only see writes to the map that preceeded the last call to refresh().

Methods

impl<K, V, M, S> ReadHandle<K, V, M, S> where
    K: Eq + Hash,
    S: BuildHasher,
    M: Clone
[src]

Returns the number of non-empty keys present in the map.

Returns true if the map contains no elements.

Get the current meta value.

Applies a function to the values corresponding to the key, and returns the result.

The key may be any borrowed form of the map's key type, but Hash and Eq on the borrowed form must match those for the key type.

Note that not all writes will be included with this read -- only those that have been refreshed by the writer. If no refresh has happened, this function returns None.

If no values exist for the given key, the function will not be called, and None will be returned.

Applies a function to the values corresponding to the key, and returns the result alongside the meta information.

The key may be any borrowed form of the map's key type, but Hash and Eq on the borrowed form must match those for the key type.

Note that not all writes will be included with this read -- only those that have been refreshed by the writer. If no refresh has happened, this function returns None.

If no values exist for the given key, the function will not be called, and Some(None, _) will be returned.

Returns true if the map contains any values for the specified key.

The key may be any borrowed form of the map's key type, but Hash and Eq on the borrowed form must match those for the key type.

Read all values in the map, and transform them into a new collection.

Be careful with this function! While the iteration is ongoing, any writer that tries to refresh will block waiting on this reader to finish.

Read all values in the map, and transform them into a new collection.

Trait Implementations

impl<K, V, M, S> Clone for ReadHandle<K, V, M, S> where
    K: Eq + Hash,
    S: BuildHasher,
    M: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more