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).
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RelayReceiver
impl !RefUnwindSafe for RelayReceiver
impl Send for RelayReceiver
impl Sync for RelayReceiver
impl Unpin for RelayReceiver
impl !UnwindSafe for RelayReceiver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more