pub struct QueueChannel<OutElem, InElem, R: 'static>{ /* private fields */ }Expand description
Implementations§
Source§impl<OutElem, InElem, R> QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> QueueChannel<OutElem, InElem, R>
Sourcepub fn from_queue_and_map(
q: Queue<OutElem>,
map_in: impl Fn(InElem) -> OutElem + Send + Sync + 'static,
) -> Self
pub fn from_queue_and_map( q: Queue<OutElem>, map_in: impl Fn(InElem) -> OutElem + Send + Sync + 'static, ) -> Self
Same wire shape as Channel::from_queue_and_map, but only the queue implementation exists.
Sourcepub fn shutdown(&self) -> Effect<(), (), ()>
pub fn shutdown(&self) -> Effect<(), (), ()>
Close the backing queue to producers; buffered values remain available to Self::read.
Sourcepub fn read(&self) -> Effect<Option<OutElem>, QueueError, R>
pub fn read(&self) -> Effect<Option<OutElem>, QueueError, R>
Read the next element, or None when the queue has ended / disconnected.
Source§impl<T, R> QueueChannel<T, T, R>
impl<T, R> QueueChannel<T, T, R>
Sourcepub fn duplex_unbounded() -> Effect<QueueChannel<T, T, R>, (), ()>
pub fn duplex_unbounded() -> Effect<QueueChannel<T, T, R>, (), ()>
Unbounded duplex with identity map-in (same as Channel::duplex_unbounded for the queue case).
Sourcepub fn to_stream(&self) -> Stream<T, QueueError, R>
pub fn to_stream(&self) -> Stream<T, QueueError, R>
Same drain semantics as Channel::to_stream: one bootstrap pull over QueueChannel::read.
Call QueueChannel::shutdown when no further writes are expected so Stream::run_collect
can finish.
Trait Implementations§
Source§impl<OutElem, InElem, R> Clone for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> Clone for QueueChannel<OutElem, InElem, R>
Auto Trait Implementations§
impl<OutElem, InElem, R> Freeze for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> !RefUnwindSafe for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> Send for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> Sync for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> Unpin for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> UnsafeUnpin for QueueChannel<OutElem, InElem, R>
impl<OutElem, InElem, R> !UnwindSafe for QueueChannel<OutElem, InElem, R>
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