pub struct RelayBridge { /* private fields */ }Expand description
Maps two authorized Operate events into a caller-owned command snapshot. The consumption control uses true for dimming and false for release.
Implementations§
Source§impl RelayBridge
impl RelayBridge
Sourcepub fn new(generation: &str, consumption: &str) -> Result<Self, BridgeError>
pub fn new(generation: &str, consumption: &str) -> Result<Self, BridgeError>
Configure two distinct control object references from the installation’s SCL model.
Sourcepub fn apply(
&self,
desired: &mut RelayState,
event: &ControlEvent,
expires_at: Duration,
now: Duration,
) -> Result<(), BridgeError>
pub fn apply( &self, desired: &mut RelayState, event: &ControlEvent, expires_at: Duration, now: Duration, ) -> Result<(), BridgeError>
Update only the addressed function after all checks pass. The caller authenticates and authorizes the event before invoking this method.
Auto Trait Implementations§
impl Freeze for RelayBridge
impl RefUnwindSafe for RelayBridge
impl Send for RelayBridge
impl Sync for RelayBridge
impl Unpin for RelayBridge
impl UnsafeUnpin for RelayBridge
impl UnwindSafe for RelayBridge
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