pub struct SimHandle { /* private fields */ }Expand description
Controls a running simulator.
Implementations§
Source§impl SimHandle
impl SimHandle
Sourcepub async fn press(&self, name: &str) -> Option<u16>
pub async fn press(&self, name: &str) -> Option<u16>
Presses a node’s button: it joins while inclusion runs, leaves while exclusion runs. Returns its node id (new or former).
Sourcepub async fn power_on(&self, name: &str) -> bool
pub async fn power_on(&self, name: &str) -> bool
Powers on a SmartStart node: it asks for inclusion while the controller listens.
Sourcepub async fn wake_up(&self, name: &str) -> bool
pub async fn wake_up(&self, name: &str) -> bool
Wakes a sleeping node: it sends a Wake Up Notification.
Sourcepub async fn set_sensor(&self, name: &str, sensor_type: u8, value: f64) -> bool
pub async fn set_sensor(&self, name: &str, sensor_type: u8, value: f64) -> bool
Changes a sensor reading; a node with a lifeline reports it.
Sourcepub async fn motion(&self, name: &str) -> bool
pub async fn motion(&self, name: &str) -> bool
The node detects motion and sends a Notification Report.
Sourcepub async fn inspect<T: Send + 'static>(
&self,
name: &str,
f: impl FnOnce(&SimNode) -> T + Send + 'static,
) -> Option<T>
pub async fn inspect<T: Send + 'static>( &self, name: &str, f: impl FnOnce(&SimNode) -> T + Send + 'static, ) -> Option<T>
Reads something from a node’s state.
Sourcepub async fn granted(&self, name: &str) -> Vec<SecurityClass>
pub async fn granted(&self, name: &str) -> Vec<SecurityClass>
The classes the node holds keys for.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimHandle
impl RefUnwindSafe for SimHandle
impl Send for SimHandle
impl Sync for SimHandle
impl Unpin for SimHandle
impl UnsafeUnpin for SimHandle
impl UnwindSafe for SimHandle
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