pub struct RelayReceiver { /* private fields */ }Expand description
A receiver handle for subscribing to channel messages.
This type is Clone but does not keep the channel alive.
When the RelaySender is dropped, all subscriptions will return None.
Implementations§
Source§impl RelayReceiver
impl RelayReceiver
Sourcepub fn subscribe<T: 'static + Send + Sync>(&self) -> Subscription<T>
pub fn subscribe<T: 'static + Send + Sync>(&self) -> Subscription<T>
Subscribe to messages of type T.
Returns a Subscription that yields messages until the channel closes.
Sourcepub fn subscribe_all(&self) -> Receiver<Envelope>
pub fn subscribe_all(&self) -> Receiver<Envelope>
Subscribe to all messages regardless of type.
Returns raw Envelopes containing type-erased values.
Sourcepub fn subscribe_tracked<T: 'static + Send + Sync>(
&self,
) -> (Subscription<T>, Arc<AtomicUsize>)
pub fn subscribe_tracked<T: 'static + Send + Sync>( &self, ) -> (Subscription<T>, Arc<AtomicUsize>)
Subscribe with completion tracking (for internal use). Returns (subscription, handler_count). The subscription is immediately ready to receive messages (channel is created and buffering).
Sourcepub fn sink<T, F, R>(&self, f: F)
pub fn sink<T, F, R>(&self, f: F)
Attach a handler that consumes messages of type T.
The sender will wait for this handler to complete before send() returns.
Errors and panics are propagated back to the sender via the completion tracker.
Trait Implementations§
Source§impl Clone for RelayReceiver
impl Clone for RelayReceiver
Source§fn clone(&self) -> RelayReceiver
fn clone(&self) -> RelayReceiver
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more