- std::thread::spawn(move || {
- let mut prev_list = List::default();
- let mut buf = [0u8; 4096];
- let mut handle_update = move |new_list: List| {
- if new_list == prev_list {
- return;
- }
- let update = Update {
- interfaces: new_list.0.clone(),
- diff: new_list.diff_from(&prev_list),
- };
- (callback)(update);
- prev_list = new_list;
+ let mut prev_list = List::default();
+ let mut handle_update = move |new_list: List| {
+ if new_list == prev_list {
+ return;
+ }
+ let update = Update {
+ interfaces: new_list.0.clone(),
+ diff: new_list.diff_from(&prev_list),