From f53b4eac8ef30da82cd8228e6fdc56d7c5e9117f Mon Sep 17 00:00:00 2001 From: Gregor Reitzenstein Date: Thu, 17 Sep 2020 09:01:00 +0200 Subject: [PATCH] Adds an event network draft --- src/main.rs | 1 + src/network.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 19ae35c..25bc642 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,7 @@ mod error; mod machine; mod connection; mod registries; +mod network; use signal_hook::iterator::Signals; diff --git a/src/network.rs b/src/network.rs index c6340f3..e9d0e6b 100644 --- a/src/network.rs +++ b/src/network.rs @@ -19,7 +19,15 @@ impl Network { /// /// Idea being that bffh builds an event network that filters an incoming event into an /// the appropiate (sub)set of signal handlers based on pretty dynamic configuration. - pub fn filter bool>(&mut self) { + pub fn filter, F: Fn(&B) -> bool>(&mut self, ) { unimplemented!() } } + +enum Event { + +} + +trait Filter { + fn filter(&self, f: Fn(&S) -> bool); +}