Struct Map

Source
pub struct Map<I, F> { /* private fields */ }
Expand description

Event iterator that maps the events with a closure

This struct is created by the EventIterator::map() method. See its documentation for more.

Trait Implementations§

Source§

impl<I, F> Debug for Map<I, F>
where I: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B, I, F> EventIterator for Map<I, F>
where I: EventIterator + Unpin, F: for<'me> FnMut(I::Event<'me>) -> B + 'static + Unpin,

Source§

type Event<'me> = B where I: 'me

The type of the events being iterated over
Source§

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 more
Source§

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,

Create a future that resolves to the next event in the event iterator. Read more
Source§

fn next_unpinned(&self) -> Next<'_, Self>
where Self: Sized + Unpin,

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>
where Self: Sized, F: for<'me> FnMut(Self::Event<'me>) -> B,

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>
where Self: Sized, P: for<'me> FnMut(&Self::Event<'me>) -> bool,

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>
where Self: Sized, F: for<'me> FnMut(Self::Event<'me>) -> Option<B>,

Create an event iterator that both filters and maps. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where Self: Sized, F: for<'me> FnMut(&Self::Event<'me>),

Do something with each event of an event iterator, passing the value on. Read more
Source§

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,

Create an event iterator which ends after the first Ready(None). Read more
Source§

fn tear(self) -> Tear<Self>
where Self: Sized,

Create an event iterator which ends after the first Ready(None). Read more
Source§

fn take(self, n: usize) -> Take<Self>
where Self: Sized,

Create an event iterator that yields the first n events, or fewer if the underlying event iterator ends sooner. Read more
Source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where Self: Sized, P: for<'me> FnMut(&Self::Event<'me>) -> bool,

Create an event iterator that yields elements based on a predicate. Read more

Auto Trait Implementations§

§

impl<I, F> !Freeze for Map<I, F>

§

impl<I, F> !RefUnwindSafe for Map<I, F>

§

impl<I, F> Send for Map<I, F>
where I: Send, F: Send,

§

impl<I, F> !Sync for Map<I, F>

§

impl<I, F> Unpin for Map<I, F>
where I: Unpin, F: Unpin,

§

impl<I, F> UnwindSafe for Map<I, F>
where I: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'b, T> AsEventIterator<'b> for T
where T: EventIterator + Unpin + 'b,

Source§

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>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.