pub struct AppEventStream { /* private fields */ }Expand description
Event bus handle and initial subscription, obtained from App::event_stream.
Lets callers attach additional sinks before execution starts, or consume the broadcast feed as an async stream, blocking iterator, or timed poll.
Implementations§
Source§impl AppEventStream
impl AppEventStream
Sourcepub fn event_stream(&mut self) -> Result<&mut EventStream, AppEventStreamError>
pub fn event_stream(&mut self) -> Result<&mut EventStream, AppEventStreamError>
Mutable reference to the underlying broadcast subscription.
Sourcepub fn into_stream(self) -> Result<EventStream, AppEventStreamError>
pub fn into_stream(self) -> Result<EventStream, AppEventStreamError>
Consume the handle and return the raw event stream.
Sourcepub fn into_event_bus(self) -> EventBus
pub fn into_event_bus(self) -> EventBus
Consume the handle and return the event bus.
Sourcepub fn split(self) -> Result<(EventBus, EventStream), AppEventStreamError>
pub fn split(self) -> Result<(EventBus, EventStream), AppEventStreamError>
Split the handle into the bus and event stream.
Sourcepub fn into_blocking_iter(
self,
) -> Result<BlockingEventIter, AppEventStreamError>
pub fn into_blocking_iter( self, ) -> Result<BlockingEventIter, AppEventStreamError>
Convert into a blocking iterator.
Sourcepub fn into_async_stream(
self,
) -> Result<BoxStream<'static, Event>, AppEventStreamError>
pub fn into_async_stream( self, ) -> Result<BoxStream<'static, Event>, AppEventStreamError>
Convert into a boxed async stream.
Sourcepub async fn next_timeout(
&mut self,
duration: Duration,
) -> Result<Option<Event>, AppEventStreamError>
pub async fn next_timeout( &mut self, duration: Duration, ) -> Result<Option<Event>, AppEventStreamError>
Await the next event with a timeout, skipping lag notifications.
Auto Trait Implementations§
impl !Freeze for AppEventStream
impl RefUnwindSafe for AppEventStream
impl Send for AppEventStream
impl Sync for AppEventStream
impl Unpin for AppEventStream
impl UnsafeUnpin for AppEventStream
impl UnwindSafe for AppEventStream
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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