Struct evmap::ReadHandle

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

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().

Implementations

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, no refresh has happened, or the map has been destroyed, then 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, or if the map has been closed by the writer, this function returns None.

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

If the writer has destroyed this map, this method will return true.

See WriteHandle::destroy.

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

Returns a copy of the value. Read more
Performs copy-assignment from source. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.