Struct MqttContext
pub struct MqttContext {
pub manager: SubscriberManager,
pub error: Option<Error>,
pub connected: Sender<bool>,
}Expand description
A struct that holds the context for an MQTT connection, including a subscriber manager and any connection errors that have occurred.
Fields§
§manager: SubscriberManager§error: Option<Error>§connected: Sender<bool>Implementations§
§impl MqttContext
impl MqttContext
pub fn new(manager: SubscriberManager, error: Option<Error>) -> Self
pub fn check_connection(&mut self) -> Result<()>
pub fn check_connection(&mut self) -> Result<()>
Checks the connection status and returns an error if there is one.
This function checks the connection status of the MQTT client and
returns an error if there is one. If there is no error, it returns
Ok(()).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MqttContext
impl !RefUnwindSafe for MqttContext
impl Send for MqttContext
impl Sync for MqttContext
impl Unpin for MqttContext
impl !UnwindSafe for MqttContext
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