pub struct PlatoEngine {
pub sensors: Vec<SensorSpec>,
pub actuators: Vec<ActuatorSpec>,
pub alarms: Vec<AlarmRule>,
pub history: HistoryBuffer,
pub tick_hz: f64,
pub tick_index: u64,
pub start_time: f64,
pub streaming: bool,
pub alarm_fires: Vec<String>,
}Expand description
The core engine: sensors, actuators, history, alarms.
Fields§
§sensors: Vec<SensorSpec>§actuators: Vec<ActuatorSpec>§alarms: Vec<AlarmRule>§history: HistoryBuffer§tick_hz: f64§tick_index: u64§start_time: f64§streaming: bool§alarm_fires: Vec<String>Alarm names that fired on the last tick (consumed by protocol handler).
Implementations§
Source§impl PlatoEngine
impl PlatoEngine
Sourcepub fn builder() -> PlatoEngineBuilder
pub fn builder() -> PlatoEngineBuilder
Create a new builder.
Sourcepub fn set_actuator(&mut self, name: &str, value: f64) -> Result<bool, String>
pub fn set_actuator(&mut self, name: &str, value: f64) -> Result<bool, String>
Set an actuator by name.
Sourcepub fn unsubscribe(&mut self)
pub fn unsubscribe(&mut self)
Unsubscribe from live updates.
Sourcepub fn handle_command(&mut self, command: &str) -> String
pub fn handle_command(&mut self, command: &str) -> String
Handle a text command.
Auto Trait Implementations§
impl !RefUnwindSafe for PlatoEngine
impl !UnwindSafe for PlatoEngine
impl Freeze for PlatoEngine
impl Send for PlatoEngine
impl Sync for PlatoEngine
impl Unpin for PlatoEngine
impl UnsafeUnpin for PlatoEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more