Move Sensor into initiator.rs

This commit is contained in:
Gregor Reitzenstein 2020-12-09 10:51:47 +01:00
parent fc477d2d56
commit 21d6abda24
4 changed files with 4 additions and 12 deletions

View File

@ -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<User>, MachineState)>;
}
type BoxSensor = Box<dyn Sensor + Send>;
pub struct Initiator {

View File

@ -13,7 +13,6 @@ mod api;
mod config;
mod error;
mod connection;
mod registries;
mod schema;
mod db;
mod machine;

View File

@ -1 +0,0 @@
pub mod sensors;

View File

@ -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<User>, MachineState)>;
}