[−][src]Struct rumqttc::MqttState
State of the mqtt connection.
Fields
await_pingresp: bool
Status of last ping
collision_ping_count: usize
Collision ping count. Collisions stop user requests which inturn trigger pings. Multiple pings without resolving collisions will result in error Last incoming packet time
collision: Option<Publish>
Last collision due to broker not acking in order
events: VecDeque<Event>
Buffered incoming packets
write: BytesMut
Write buffer
Implementations
impl MqttState
[src]
pub fn new(max_inflight: u16) -> Self
[src]
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 clean(&mut self) -> Vec<Request>
[src]
Returns inflight outgoing packets and clears internal queues
pub fn inflight(&self) -> u16
[src]
pub fn handle_outgoing_packet(
&mut self,
request: Request
) -> Result<(), StateError>
[src]
&mut self,
request: Request
) -> Result<(), StateError>
Consolidates handling of all outgoing mqtt packet logic. Returns a packet which should be put on to the network by the eventloop
pub fn handle_incoming_packet(
&mut self,
packet: Incoming
) -> Result<(), StateError>
[src]
&mut self,
packet: Incoming
) -> Result<(), StateError>
Consolidates handling of all incoming mqtt packets. Returns a Notification
which for the
user to consume and Packet
which for the eventloop to put on the network
E.g For incoming QoS1 publish packet, this method returns (Publish, Puback). Publish packet will
be forwarded to user and Pubck packet will be written to network
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MqttState
impl Send for MqttState
impl Sync for MqttState
impl Unpin for MqttState
impl UnwindSafe for MqttState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,