pub struct HashMapSubscription<K, V, Codec = Default> { /* private fields */ }Expand description
Observable hash map subscription.
This can be sent to a remote endpoint via a remote channel. Then, on the remote endpoint, mirror can be used to build and keep up-to-date a mirror of the observed hash map.
The event stream can also be processed event-wise using recv. If the subscription is not incremental take_initial must be called before the first call to recv.
Implementations§
Source§impl<K, V, Codec> HashMapSubscription<K, V, Codec>
impl<K, V, Codec> HashMapSubscription<K, V, Codec>
Sourcepub fn is_incremental(&self) -> bool
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn is_incremental(&self) -> bool
Returns whether the subscription is incremental.
Sourcepub fn is_complete(&self) -> bool
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn is_complete(&self) -> bool
Returns whether the initial value event or stream of events that build up the initial value has completed or take_initial has been called.
Sourcepub fn is_done(&self) -> bool
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn is_done(&self) -> bool
Returns whether the observed hash map has indicated that no further change events will occur.
Sourcepub fn take_initial(&mut self) -> Option<HashMap<K, V>>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn take_initial(&mut self) -> Option<HashMap<K, V>>
Take the initial value.
This is only possible if the subscription is not incremental
and the initial value has not already been taken.
Otherwise None is returned.
If the subscription is not incremental this must be called before the first call to recv.
Sourcepub async fn recv(&mut self) -> Result<Option<HashMapEvent<K, V>>, RecvError>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub async fn recv(&mut self) -> Result<Option<HashMapEvent<K, V>>, RecvError>
Receives the next change event.
§Panics
Panics when the subscription is not incremental and take_initial has not been called.
Source§impl<K, V, Codec> HashMapSubscription<K, V, Codec>
impl<K, V, Codec> HashMapSubscription<K, V, Codec>
Sourcepub fn mirror(self, max_size: usize) -> MirroredHashMap<K, V, Codec>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn mirror(self, max_size: usize) -> MirroredHashMap<K, V, Codec>
Mirror the hash map that this subscription is observing.
max_size specifies the maximum allowed size of the mirrored collection.
If this size is reached, processing of events is stopped and
RecvError::MaxSizeExceeded is returned.