pub struct StreamReceiver<T: Send + 'static> { /* private fields */ }Expand description
A receiver handle given to the actor’s ReduceHandler.
The caller pushes items from a BoxStream into the channel; the actor
consumes them through this receiver. Can be used directly with recv()
or converted into a BoxStream via into_stream().
Implementations§
Source§impl<T: Send + 'static> StreamReceiver<T>
impl<T: Send + 'static> StreamReceiver<T>
Sourcepub fn new(inner: Receiver<T>) -> Self
pub fn new(inner: Receiver<T>) -> Self
Create a new StreamReceiver wrapping a tokio mpsc receiver.
Sourcepub async fn recv(&mut self) -> Option<T>
pub async fn recv(&mut self) -> Option<T>
Receive the next item, or None when the sender is closed.
Sourcepub fn into_stream(self) -> BoxStream<T>
pub fn into_stream(self) -> BoxStream<T>
Convert into a BoxStream for use with StreamExt combinators.
Auto Trait Implementations§
impl<T> Freeze for StreamReceiver<T>
impl<T> RefUnwindSafe for StreamReceiver<T>
impl<T> Send for StreamReceiver<T>
impl<T> Sync for StreamReceiver<T>
impl<T> Unpin for StreamReceiver<T>
impl<T> UnsafeUnpin for StreamReceiver<T>
impl<T> UnwindSafe for StreamReceiver<T>
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