pub struct MonitorState { /* private fields */ }Expand description
Mirrors the in-memory state maintained by Python’s monitor_server.py.
Implementations§
Source§impl MonitorState
impl MonitorState
Sourcepub fn parse_topic(
&mut self,
topic: &str,
payload: Value,
) -> Option<(Value, bool)>
pub fn parse_topic( &mut self, topic: &str, payload: Value, ) -> Option<(Value, bool)>
Parse one MQTT message and update internal state.
Returns Some((event, is_heartbeat)) when something should be
broadcast, or None when the topic is not recognised.
is_heartbeat suppresses the event from the browser’s log feed
(mirrors Python behaviour).
Trait Implementations§
Source§impl Debug for MonitorState
impl Debug for MonitorState
Source§impl Default for MonitorState
impl Default for MonitorState
Source§fn default() -> MonitorState
fn default() -> MonitorState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MonitorState
impl RefUnwindSafe for MonitorState
impl Send for MonitorState
impl Sync for MonitorState
impl Unpin for MonitorState
impl UnwindSafe for MonitorState
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