Struct remoc_obs::hashmap::HashMapSubscription
source · [−]pub struct HashMapSubscription<K, V, Codec = Default> {
pub initial: HashMap<K, V>,
pub events: Receiver<HashMapEvent<K, V>, Codec>,
}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.
You can also break apart this structure and use the event stream directly.
Fields
initial: HashMap<K, V>Value of hash map at time of subscription.
events: Receiver<HashMapEvent<K, V>, Codec>Change events receiver.
Implementations
sourceimpl<K, V, Codec> HashMapSubscription<K, V, Codec> where
K: RemoteSend + Eq + Hash + Clone + Sync,
V: RemoteSend + Clone + Sync,
Codec: Codec,
impl<K, V, Codec> HashMapSubscription<K, V, Codec> where
K: RemoteSend + Eq + Hash + Clone + Sync,
V: RemoteSend + Clone + Sync,
Codec: Codec,
sourcepub fn mirror(self) -> MirroredHashMap<K, V, Codec>
pub fn mirror(self) -> MirroredHashMap<K, V, Codec>
Mirror the observed hash map that this subscription is receiving events from.
Trait Implementations
sourceimpl<'de, K, V, Codec> Deserialize<'de> for HashMapSubscription<K, V, Codec> where
K: RemoteSend + Eq + Hash,
V: RemoteSend,
Codec: Codec,
impl<'de, K, V, Codec> Deserialize<'de> for HashMapSubscription<K, V, Codec> where
K: RemoteSend + Eq + Hash,
V: RemoteSend,
Codec: Codec,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<K, V, Codec> Serialize for HashMapSubscription<K, V, Codec> where
K: RemoteSend + Eq + Hash,
V: RemoteSend,
Codec: Codec,
impl<K, V, Codec> Serialize for HashMapSubscription<K, V, Codec> where
K: RemoteSend + Eq + Hash,
V: RemoteSend,
Codec: Codec,
Auto Trait Implementations
impl<K, V, Codec = Default> !RefUnwindSafe for HashMapSubscription<K, V, Codec>
impl<K, V, Codec> Send for HashMapSubscription<K, V, Codec> where
Codec: Send,
K: Send,
V: Send,
impl<K, V, Codec> Sync for HashMapSubscription<K, V, Codec> where
Codec: Sync,
K: Send + Sync,
V: Send + Sync,
impl<K, V, Codec> Unpin for HashMapSubscription<K, V, Codec> where
K: Unpin,
V: Unpin,
impl<K, V, Codec = Default> !UnwindSafe for HashMapSubscription<K, V, Codec>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more