pub struct BoundedSourceQueue<T> { /* private fields */ }Expand description
Materialized handle of Source::queue_bounded: a synchronous, bounded, lock-free queue with
no overflow strategy (a full buffer drops). Clone; the stream completes when the last handle
is dropped.
Implementations§
Source§impl<T> BoundedSourceQueue<T>
impl<T> BoundedSourceQueue<T>
Sourcepub fn offer(&self, elem: T) -> QueueOfferResult
pub fn offer(&self, elem: T) -> QueueOfferResult
Offer one element. Returns immediately (never blocks): QueueOfferResult::Enqueued on
success, QueueOfferResult::Dropped if the buffer is full, or
QueueOfferResult::QueueClosed after completion/failure.
Sourcepub fn complete(&self)
pub fn complete(&self)
Complete the stream after buffered elements drain (idempotent; first terminal signal wins).
Sourcepub fn fail(&self, error: StreamError)
pub fn fail(&self, error: StreamError)
Fail the stream; buffered elements drain before the error surfaces downstream.
Trait Implementations§
Source§impl<T: Clone> Clone for BoundedSourceQueue<T>
impl<T: Clone> Clone for BoundedSourceQueue<T>
Source§fn clone(&self) -> BoundedSourceQueue<T>
fn clone(&self) -> BoundedSourceQueue<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Drop for BoundedSourceQueue<T>
impl<T> Drop for BoundedSourceQueue<T>
Auto Trait Implementations§
impl<T> Freeze for BoundedSourceQueue<T>
impl<T> RefUnwindSafe for BoundedSourceQueue<T>
impl<T> Send for BoundedSourceQueue<T>where
T: Send,
impl<T> Sync for BoundedSourceQueue<T>where
T: Send,
impl<T> Unpin for BoundedSourceQueue<T>
impl<T> UnsafeUnpin for BoundedSourceQueue<T>
impl<T> UnwindSafe for BoundedSourceQueue<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