Function vector_stream::expiration_map::map_with_expiration
source ยท pub fn map_with_expiration<S, T, M, E, F>(
initial_state: S,
input: impl Stream<Item = T> + 'static,
expiration_interval: Duration,
map_fn: M,
expiration_fn: E,
flush_fn: F,
) -> impl Stream<Item = T>
Expand description
Similar to stream.filter_map(..).flatten(..)
but also allows checking for expired events
and flushing when the input stream ends.