mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-22 14:57:56 +01:00
Move Sensor into initiator.rs
This commit is contained in:
parent
fc477d2d56
commit
21d6abda24
@ -14,11 +14,14 @@ use crate::machine::{Machine, ReturnToken};
|
|||||||
use crate::db::machine::MachineState;
|
use crate::db::machine::MachineState;
|
||||||
use crate::db::user::{User, UserId, UserData};
|
use crate::db::user::{User, UserId, UserData};
|
||||||
|
|
||||||
use crate::registries::sensors::Sensor;
|
|
||||||
use crate::network::InitMap;
|
use crate::network::InitMap;
|
||||||
|
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
|
|
||||||
|
pub trait Sensor {
|
||||||
|
fn run_sensor(&mut self) -> BoxFuture<'static, (Option<User>, MachineState)>;
|
||||||
|
}
|
||||||
|
|
||||||
type BoxSensor = Box<dyn Sensor + Send>;
|
type BoxSensor = Box<dyn Sensor + Send>;
|
||||||
|
|
||||||
pub struct Initiator {
|
pub struct Initiator {
|
||||||
|
@ -13,7 +13,6 @@ mod api;
|
|||||||
mod config;
|
mod config;
|
||||||
mod error;
|
mod error;
|
||||||
mod connection;
|
mod connection;
|
||||||
mod registries;
|
|
||||||
mod schema;
|
mod schema;
|
||||||
mod db;
|
mod db;
|
||||||
mod machine;
|
mod machine;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
pub mod sensors;
|
|
@ -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)>;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user