From a80e64014c21e092e35080baf29b2611d18c486a Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Tue, 27 Aug 2019 11:28:20 +0200 Subject: Unbox callback closures Accepted the more verbose type signatures and added a callback to request new key-material. --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ae90251..5c58b24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,8 +27,9 @@ fn main() { let router = router::Device::new( 4, - |t: &PeerTimer, data: bool| t.a.reset(Duration::from_millis(1000)), - |t: &PeerTimer, data: bool| t.b.reset(Duration::from_millis(1000)), + |t: &PeerTimer, data: bool, sent: bool| t.a.reset(Duration::from_millis(1000)), + |t: &PeerTimer, data: bool, sent: bool| t.b.reset(Duration::from_millis(1000)), + |t: &PeerTimer| println!("new key requested"), ); let pt = PeerTimer { -- cgit v1.2.3-59-g8ed1b