pub struct Subscription<I> { /* private fields */ }Expand description
One independent, live subscription. Dropping it also closes it.
Implementations§
Source§impl<I: Clone> Subscription<I>
impl<I: Clone> Subscription<I>
Sourcepub async fn next(&self) -> Option<EventEnvelope<I>>
pub async fn next(&self) -> Option<EventEnvelope<I>>
Return the next item, or None after close. No runtime is needed to emit.
Sourcepub async fn next_for_callback(&self) -> Option<EventLease<I>>
pub async fn next_for_callback(&self) -> Option<EventLease<I>>
Keep a callback’s item inside the queue bound until its returned value completes.
Sourcepub fn drain(&self) -> Vec<EventEnvelope<I>>
pub fn drain(&self) -> Vec<EventEnvelope<I>>
Drain ready items after a worker wake. This includes a pending lagged item.
Trait Implementations§
Source§impl<I> Drop for Subscription<I>
impl<I> Drop for Subscription<I>
Auto Trait Implementations§
impl<I> Freeze for Subscription<I>
impl<I> !RefUnwindSafe for Subscription<I>
impl<I> Send for Subscription<I>where
I: Send,
impl<I> Sync for Subscription<I>where
I: Send,
impl<I> Unpin for Subscription<I>
impl<I> UnsafeUnpin for Subscription<I>
impl<I> !UnwindSafe for Subscription<I>
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
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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