pub struct DeferredStreamProcessor { /* private fields */ }Expand description
Background processor for streams Handles streams to completion, passing each item from the stream to a callback
Implementations§
Source§impl DeferredStreamProcessor
impl DeferredStreamProcessor
Sourcepub fn add_stream<T: Send + 'static, S: Stream<Item = T> + Unpin + Send + 'static>(
&self,
receiver: S,
handler: impl FnMut(T) -> PinBoxFutureStatic<DeferredStreamResult> + Send + 'static,
) -> bool
pub fn add_stream<T: Send + 'static, S: Stream<Item = T> + Unpin + Send + 'static>( &self, receiver: S, handler: impl FnMut(T) -> PinBoxFutureStatic<DeferredStreamResult> + Send + 'static, ) -> bool
Queue a stream to process in the background
- ‘receiver’ is the stream to process
- ‘handler’ is the callback to handle each item from the stream
Returns ‘true’ if the stream was added for processing, and ‘false’ if the stream could not be added, possibly due to not being initialized.
Trait Implementations§
Source§impl Debug for DeferredStreamProcessor
impl Debug for DeferredStreamProcessor
Auto Trait Implementations§
impl !Freeze for DeferredStreamProcessor
impl !RefUnwindSafe for DeferredStreamProcessor
impl Send for DeferredStreamProcessor
impl Sync for DeferredStreamProcessor
impl Unpin for DeferredStreamProcessor
impl UnwindSafe for DeferredStreamProcessor
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> 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