pub struct MqttState {
pub connection_status: MqttConnectionStatus,
pub await_pingresp: bool,
pub last_incoming: Instant,
pub last_outgoing: Instant,
pub last_pkid: PacketIdentifier,
pub outgoing_pub: VecDeque<Publish>,
pub outgoing_rel: VecDeque<PacketIdentifier>,
pub incoming_pub: VecDeque<PacketIdentifier>,
}
Expand description
State of the mqtt connection.
Fields§
§connection_status: MqttConnectionStatus
Connection status
await_pingresp: bool
Status of last ping
last_incoming: Instant
Last incoming packet time
last_outgoing: Instant
Last outgoing packet time
last_pkid: PacketIdentifier
Packet id of the last outgoing packet
outgoing_pub: VecDeque<Publish>
Outgoing QoS 1, 2 publishes which aren’t acked yet
outgoing_rel: VecDeque<PacketIdentifier>
Packet ids of released QoS 2 publishes
incoming_pub: VecDeque<PacketIdentifier>
Packet ids on incoming QoS 2 publishes
Implementations§
Source§impl MqttState
impl MqttState
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates new mqtt state. Same state should be used during a connection for persistent sessions while new state should instantiated for clean sessions
pub fn handle_outgoing_connect(&mut self) -> Result<(), StateError>
pub fn handle_incoming_connack( &mut self, packet: Packet, ) -> Result<(), StateError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MqttState
impl RefUnwindSafe for MqttState
impl Send for MqttState
impl Sync for MqttState
impl Unpin for MqttState
impl UnwindSafe for MqttState
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