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()
.
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.
Performs copy-assignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static