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) -> EmitFuture<'_, Result<T, E>> ⓘ
pub fn emit(&self, value: T) -> EmitFuture<'_, Result<T, E>> ⓘ
Emit value from a stream and wait until stream consumer calls futures_util::StreamExt::next again.
§Panics
Will panic if:
emit/emit_erris called twice without awaiting result of the first callemitis called not in context of polling the stream
Sourcepub fn emit_err(&self, err: E) -> EmitFuture<'_, Result<T, E>> ⓘ
pub fn emit_err(&self, err: E) -> EmitFuture<'_, Result<T, E>> ⓘ
Emit error from a stream and wait until stream consumer calls futures_util::StreamExt::next again.
§Panics
Will panic if:
emit/emit_erris called twice without awaiting result of the first callemit_erris called not in context of polling the stream
Trait Implementations§
impl<T: RefUnwindSafe, E: RefUnwindSafe> RefUnwindSafe for TryStreamEmitter<T, E>
impl<T: Send, E: Send> Send for TryStreamEmitter<T, E>
impl<T: Send, E: Send> Sync for TryStreamEmitter<T, E>
impl<T: UnwindSafe, E: UnwindSafe> UnwindSafe for TryStreamEmitter<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for TryStreamEmitter<T, E>
impl<T, E> Unpin 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