From 406cebadb89f1eb3fa8bc98e9c9e684ae2265398 Mon Sep 17 00:00:00 2001 From: Gregor Reitzenstein Date: Thu, 17 Sep 2020 11:20:55 +0200 Subject: [PATCH] Sensor implementation draft --- src/registries/sensors.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/registries/sensors.rs diff --git a/src/registries/sensors.rs b/src/registries/sensors.rs new file mode 100644 index 0000000..3508b2e --- /dev/null +++ b/src/registries/sensors.rs @@ -0,0 +1,16 @@ +use futures::{Future, Stream}; + +pub struct Sensors { + +} + + +// Implementing Sensors. +// +// Given the coroutine/task split stays as it is - Sensor input to machine update being one, +// machine update signal to actor doing thing being another, a Sensor implementation would send a +// Stream of futures - each future being an atomic Machine update. +#[async_trait] +pub trait Sensor: Stream>> { + async fn setup() -> Self; +}