pub struct Once<E>(/* private fields */);
Expand description
Event iterator that yields a single event
This event iterator is created by the once()
function. See its
documentation for more.
Trait Implementations§
Source§impl<E> EventIterator for Once<E>
impl<E> EventIterator for Once<E>
Source§fn poll_next<'a>(
self: Pin<&'a Self>,
_cx: &mut Context<'_>,
) -> Poll<Option<Self::Event<'a>>>
fn poll_next<'a>( self: Pin<&'a Self>, _cx: &mut Context<'_>, ) -> Poll<Option<Self::Event<'a>>>
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 size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Return the bounds on the remaining length of the event iterator. Read more
Source§fn next<'a>(self: Pin<&'a Self>) -> Next<'a, Self> ⓘwhere
Self: Sized,
fn next<'a>(self: Pin<&'a Self>) -> Next<'a, Self> ⓘwhere
Self: Sized,
Create a future that resolves to the next event in the event iterator. Read more
Source§fn next_unpinned(&self) -> Next<'_, Self> ⓘ
fn next_unpinned(&self) -> Next<'_, Self> ⓘ
Create a future that resolves to the next event in the event iterator. Read more
Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
Take a closure and create an event iterator which calls that closure on
each event. Read more
Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
Create an event iterator which uses a closure to determine if an event
should be yielded. Read more
Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
Create an event iterator that both filters and maps. Read more
Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Do something with each event of an event iterator, passing the value on. Read more
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
Create an event iterator which gives the current iteration count as well
as the next event. Read more
Source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
Create an event iterator which ends after the first
Ready(None)
. Read moreSource§fn tear(self) -> Tear<Self>where
Self: Sized,
fn tear(self) -> Tear<Self>where
Self: Sized,
Create an event iterator which ends after the first
Ready(None)
. Read moreAuto Trait Implementations§
impl<E> !Freeze for Once<E>
impl<E> !RefUnwindSafe for Once<E>
impl<E> Send for Once<E>where
E: Send,
impl<E> !Sync for Once<E>
impl<E> Unpin for Once<E>where
E: Unpin,
impl<E> UnwindSafe for Once<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<'b, T> AsEventIterator<'b> for Twhere
T: EventIterator + Unpin + 'b,
impl<'b, T> AsEventIterator<'b> for Twhere
T: EventIterator + Unpin + 'b,
Source§type Event = <T as EventIterator>::Event<'b>
type Event = <T as EventIterator>::Event<'b>
The type of the events being iterated over
Source§fn as_event_iter(&'b self) -> AsEventIter<'b, <T as AsEventIterator<'b>>::Event>
fn as_event_iter(&'b self) -> AsEventIter<'b, <T as AsEventIterator<'b>>::Event>
Cast to an
AsEventIter
. Read moreSource§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