From 21d6abda24b806a8314bafdf6f7a0136246f015f Mon Sep 17 00:00:00 2001 From: Gregor Reitzenstein Date: Wed, 9 Dec 2020 10:51:47 +0100 Subject: [PATCH] Move Sensor into initiator.rs --- src/initiator.rs | 5 ++++- src/main.rs | 1 - src/registries.rs | 1 - src/registries/sensors.rs | 9 --------- 4 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 src/registries.rs delete mode 100644 src/registries/sensors.rs diff --git a/src/initiator.rs b/src/initiator.rs index a5cb2d2..8b57a3b 100644 --- a/src/initiator.rs +++ b/src/initiator.rs @@ -14,11 +14,14 @@ use crate::machine::{Machine, ReturnToken}; use crate::db::machine::MachineState; use crate::db::user::{User, UserId, UserData}; -use crate::registries::sensors::Sensor; use crate::network::InitMap; use crate::error::Result; +pub trait Sensor { + fn run_sensor(&mut self) -> BoxFuture<'static, (Option, MachineState)>; +} + type BoxSensor = Box; pub struct Initiator { diff --git a/src/main.rs b/src/main.rs index ce8f4a8..ec6091a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,6 @@ mod api; mod config; mod error; mod connection; -mod registries; mod schema; mod db; mod machine; diff --git a/src/registries.rs b/src/registries.rs deleted file mode 100644 index 5743b51..0000000 --- a/src/registries.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod sensors; diff --git a/src/registries/sensors.rs b/src/registries/sensors.rs deleted file mode 100644 index 718f2f9..0000000 --- a/src/registries/sensors.rs +++ /dev/null @@ -1,9 +0,0 @@ -use std::pin::Pin; -use futures::task::{Context, Poll}; -use futures::future::BoxFuture; -use crate::db::user::User; -use crate::db::machine::MachineState; - -pub trait Sensor { - fn run_sensor(&mut self) -> BoxFuture<'static, (Option, MachineState)>; -}