Struct async_fn_stream::StreamEmitter
source · [−]pub struct StreamEmitter<T> { /* private fields */ }
Expand description
An intemediary that transfers values from stream to its consumer
Implementations
sourceimpl<T> StreamEmitter<T>
impl<T> StreamEmitter<T>
sourcepub fn emit(&self, value: T) -> CollectFutureⓘNotable traits for CollectFutureimpl Future for CollectFuture type Output = ();
pub fn emit(&self, value: T) -> CollectFutureⓘNotable traits for CollectFutureimpl Future for CollectFuture type Output = ();
Emit value from a stream and wait until stream consumer calls [futures::StreamExt::next
] again.
Panics
Will panic if:
collect
is called twice without awaiting result of first callcollect
is called not in context of polling the stream
Auto Trait Implementations
impl<T> RefUnwindSafe for StreamEmitter<T>
impl<T> Send for StreamEmitter<T> where
T: Send,
impl<T> Sync for StreamEmitter<T> where
T: Send,
impl<T> Unpin for StreamEmitter<T>
impl<T> UnwindSafe for StreamEmitter<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more