pub struct Receiver<T>(/* private fields */);
Expand description
A Relm4 receiver receives messages from a component or worker.
Implementations§
source§impl<T> Receiver<T>
impl<T> Receiver<T>
sourcepub async fn recv(&self) -> Option<T>
pub async fn recv(&self) -> Option<T>
Receives a message from a component or worker.
Returns None
if all senders have been disconnected.
sourcepub fn recv_sync(&self) -> Option<T>
pub fn recv_sync(&self) -> Option<T>
Receives a message synchronously from a component or worker.
Returns None
if all senders have been disconnected.
sourcepub fn into_stream(self) -> RecvStream<'static, T>
pub fn into_stream(self) -> RecvStream<'static, T>
Convert this receiver into a stream that asynchronously yields messages from the channel.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>where
T: Send,
impl<T> Sync for Receiver<T>where
T: Send,
impl<T> Unpin for Receiver<T>
impl<T> UnwindSafe for Receiver<T>
Blanket Implementations§
source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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