pub fn fold_vec_push<T>(acc: Option<Vec<T>>, e: T) -> Vec<T>Expand description
A fold function which combines events of type T into a Vec<T> by pushing them.
use std::{time::Duration, thread};
let (tx, rx) = debouncer(Duration::from_millis(100), fold_vec_push::<u32>);
tx.send(4).unwrap();
tx.send(5).unwrap();
thread::sleep(Duration::from_millis(150));
tx.send(3).unwrap();
tx.send(2).unwrap();
tx.send(1).unwrap();
assert_eq!(rx.recv().unwrap(), vec![4, 5]);
assert_eq!(rx.recv().unwrap(), vec![3, 2, 1]);