pub struct Channel<T = (), U: ?Sized = ()>(/* private fields */);
Expand description
An MPMC channel with both send and receive capabilities
Enable the futures_core_3
feature for Channel
to implement
Stream
(generic T
must be Option<Item>
).
Enable the event_iterator
feature for Channel
to implement
EventIterator
.
Implementations§
Trait Implementations§
Source§impl<T, U: ?Sized> EventIterator for Channel<T, U>
impl<T, U: ?Sized> EventIterator for Channel<T, U>
Source§fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<T>>
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<T>>
Attempt to pull out the next event of this event iterator, registering
the current task for wakeup if the value is not yet available, and
returning
None
if the event iterator is exhausted. Read moreSource§fn next<'a>(self: Pin<&'a mut Self>) -> Next<'a, Self>
fn next<'a>(self: Pin<&'a mut Self>) -> Next<'a, Self>
Create a future that resolves to the next event in the event iterator. Read more
Source§fn next_unpinned(&mut self) -> Next<'_, Self>where
Self: Unpin,
fn next_unpinned(&mut self) -> Next<'_, Self>where
Self: Unpin,
Create a future that resolves to the next event in the event iterator. Read more
Source§impl<T, U: ?Sized> Stream for Channel<Option<T>, U>
impl<T, U: ?Sized> Stream for Channel<Option<T>, U>
Auto Trait Implementations§
impl<T, U> Freeze for Channel<T, U>where
U: ?Sized,
impl<T = (), U = ()> !RefUnwindSafe for Channel<T, U>
impl<T, U> Send for Channel<T, U>
impl<T, U> Sync for Channel<T, U>
impl<T, U> Unpin for Channel<T, U>where
U: ?Sized,
impl<T = (), U = ()> !UnwindSafe for Channel<T, U>
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<I> IntoEventIterator for Iwhere
I: EventIterator + 'static,
impl<I> IntoEventIterator for Iwhere
I: EventIterator + 'static,
Source§type Event<'me> = <I as EventIterator>::Event<'me>
where
I: 'me
type Event<'me> = <I as EventIterator>::Event<'me> where I: 'me
The type of the event yielded by the event iterator
Source§type IntoEventIter = I
type IntoEventIter = I
The type of the resulting event iterator
Source§fn into_event_iter(self) -> <I as IntoEventIterator>::IntoEventIter
fn into_event_iter(self) -> <I as IntoEventIterator>::IntoEventIter
Convert
self
into an event iterator.Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more