pub struct FilterMap<A, F, G> { /* private fields */ }Expand description
An Adapter that passes each item through an optional function
and passes the Some values on.
Trait Implementations§
Source§impl<F, G, A, B> Adapter for FilterMap<A, F, G>
impl<F, G, A, B> Adapter for FilterMap<A, F, G>
type Item = A
Source§async fn notify(&mut self, a: Self::Item)where
Self::Item: 'static,
async fn notify(&mut self, a: Self::Item)where
Self::Item: 'static,
Forward the given item to an asynchronous consumer, possibly converting the type
or possibly dropping the item if it cannot be converted.
Source§fn clone_notify(&mut self, a: &Self::Item) -> impl Future<Output = ()> + Send
fn clone_notify(&mut self, a: &Self::Item) -> impl Future<Output = ()> + Send
Clone the referenced item and then forward it to an asynchonous consumer.
The clone operation can is avoid in the
Placeholder implementation.Source§fn merge<T>(self, other: T) -> impl Adapter<Item = Self::Item>
fn merge<T>(self, other: T) -> impl Adapter<Item = Self::Item>
Combine this with another adapter. The notify call is delegated to both adapters.
Source§fn with_filter_map<A>(
self,
func: impl Fn(A) -> Option<Self::Item> + Send,
) -> impl Adapter<Item = A>
fn with_filter_map<A>( self, func: impl Fn(A) -> Option<Self::Item> + Send, ) -> impl Adapter<Item = A>
Create an adapter that maps items with an optional function.
Some values are passed on, analogous to Iterator::filter_map.Source§fn with_map<A>(
self,
func: impl Fn(A) -> Self::Item + Send,
) -> impl Adapter<Item = A>
fn with_map<A>( self, func: impl Fn(A) -> Self::Item + Send, ) -> impl Adapter<Item = A>
Create an adapter that maps each item with a function.
Auto Trait Implementations§
impl<A, F, G> Freeze for FilterMap<A, F, G>
impl<A, F, G> RefUnwindSafe for FilterMap<A, F, G>
impl<A, F, G> Send for FilterMap<A, F, G>
impl<A, F, G> Sync for FilterMap<A, F, G>
impl<A, F, G> Unpin for FilterMap<A, F, G>
impl<A, F, G> UnwindSafe for FilterMap<A, F, G>
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