pub struct TryEmitter<T, E> { /* private fields */ }Expand description
A handle for emitting values from an async_try_stream generator.
The generator closure receives a TryEmitter<T, E> as its argument.
Implementations§
Source§impl<T, E> TryEmitter<T, E>
impl<T, E> TryEmitter<T, E>
Sourcepub fn emit(&mut self, value: T) -> impl FusedFuture<Output = ()>
pub fn emit(&mut self, value: T) -> impl FusedFuture<Output = ()>
Emits Ok(value) as the next stream item and suspends the generator.
Behaves identically to Emitter::emit: the returned future must be
awaited immediately and yields Poll::Pending on its first poll to
transfer control to the stream consumer.
§Panics
Panics if called before the previous emit future has been awaited.
Auto Trait Implementations§
impl<T, E> !RefUnwindSafe for TryEmitter<T, E>
impl<T, E> !UnwindSafe for TryEmitter<T, E>
impl<T, E> Freeze for TryEmitter<T, E>
impl<T, E> Send for TryEmitter<T, E>
impl<T, E> Sync for TryEmitter<T, E>
impl<T, E> Unpin for TryEmitter<T, E>
impl<T, E> UnsafeUnpin for TryEmitter<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more