pub trait SinkExt<Item>: Sink<Item> {
fn contra_map<S, F>(self, f: F) -> ContraMap<Self, S, Item, F>
where
Self: Sized,
F: Fn(S) -> Item,
{ ... }
fn contra_filter_map<S, F>(self, f: F) -> ContraFilterMap<Self, S, Item, F>
where
Self: Sized,
F: Fn(S) -> Option<Item>,
{ ... }
}
Provided Methods§
sourcefn contra_map<S, F>(self, f: F) -> ContraMap<Self, S, Item, F>where
Self: Sized,
F: Fn(S) -> Item,
fn contra_map<S, F>(self, f: F) -> ContraMap<Self, S, Item, F>where
Self: Sized,
F: Fn(S) -> Item,
Extend this sink using a map function.
This composes the map function in front of the sink, consuming a sink that takes
S
and returning a sink that takes Item
.
sourcefn contra_filter_map<S, F>(self, f: F) -> ContraFilterMap<Self, S, Item, F>where
Self: Sized,
F: Fn(S) -> Option<Item>,
fn contra_filter_map<S, F>(self, f: F) -> ContraFilterMap<Self, S, Item, F>where
Self: Sized,
F: Fn(S) -> Option<Item>,
Extend this sink using a filtering map function.
This composes the map function in front of the sink, much like [SinkExt::with_flat_map
]
but without async and without the option of failure.