Struct async_fn_stream::TryStreamEmitter
source · pub struct TryStreamEmitter<T, E> { /* private fields */ }
Expand description
An intermediary that transfers values from stream to its consumer
Implementations§
source§impl<T, E> TryStreamEmitter<T, E>
impl<T, E> TryStreamEmitter<T, E>
sourcepub fn emit(&self, value: T) -> CollectFuture ⓘ
pub fn emit(&self, value: T) -> CollectFuture ⓘ
Emit value from a stream and wait until stream consumer calls futures_util::StreamExt::next
again.
§Panics
Will panic if:
emit
/emit_err
is called twice without awaiting result of the first callemit
is called not in context of polling the stream
sourcepub fn emit_err(&self, err: E) -> CollectFuture ⓘ
pub fn emit_err(&self, err: E) -> CollectFuture ⓘ
Emit error from a stream and wait until stream consumer calls futures_util::StreamExt::next
again.
§Panics
Will panic if:
emit
/emit_err
is called twice without awaiting result of the first callemit_err
is called not in context of polling the stream
Auto Trait Implementations§
impl<T, E> Freeze for TryStreamEmitter<T, E>
impl<T, E> RefUnwindSafe for TryStreamEmitter<T, E>
impl<T, E> Send for TryStreamEmitter<T, E>
impl<T, E> Sync for TryStreamEmitter<T, E>
impl<T, E> Unpin for TryStreamEmitter<T, E>
impl<T, E> UnwindSafe for TryStreamEmitter<T, E>
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