Skip to main content

switch_map

Function switch_map 

Source
pub fn switch_map<T, U, S, Inner, F>(f: F, s: S) -> impl Stream<Item = U>
where S: Stream<Item = T> + Unpin, Inner: Stream<Item = U> + Unpin, F: Fn(T) -> Inner,
Expand description

Switch to new inner stream on each outer value, cancelling previous. Runtime-agnostic using futures::select!