pub struct SourceQueue<T> { /* private fields */ }Expand description
Materialized handle of Source::queue: a bounded queue with a configurable
OverflowStrategy. Under Backpressure, maxConcurrentOffers is 1 — offer blocks until
buffer space is free and a second concurrent offer errors.
Implementations§
Source§impl<T: Send + 'static> SourceQueue<T>
impl<T: Send + 'static> SourceQueue<T>
Sourcepub fn watch_completion(self) -> StreamCompletion<NotUsed> ⓘ
pub fn watch_completion(self) -> StreamCompletion<NotUsed> ⓘ
Take the one-shot completion handle for this queue (resolves when the stream ends). Only the
original handle holds it; a cloned SourceQueue returns an error completion.
Sourcepub fn offer(&self, elem: T) -> StreamResult<QueueOfferResult>
pub fn offer(&self, elem: T) -> StreamResult<QueueOfferResult>
Offer one element, applying the configured OverflowStrategy. Returns Err only when a
second concurrent offer races a pending Backpressure offer; otherwise the outcome is in
the QueueOfferResult.
Sourcepub fn fail(&self, error: StreamError)
pub fn fail(&self, error: StreamError)
Fail the stream with error (first terminal signal wins).
Trait Implementations§
Source§impl<T> Clone for SourceQueue<T>
impl<T> Clone for SourceQueue<T>
Source§impl<T> Drop for SourceQueue<T>
impl<T> Drop for SourceQueue<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for SourceQueue<T>
impl<T> !UnwindSafe for SourceQueue<T>
impl<T> Freeze for SourceQueue<T>
impl<T> Send for SourceQueue<T>where
T: Send,
impl<T> Sync for SourceQueue<T>where
T: Send,
impl<T> Unpin for SourceQueue<T>
impl<T> UnsafeUnpin for SourceQueue<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage