Struct rumqttc_async_std::MqttState[][src]

pub struct MqttState {
    pub await_pingresp: bool,
    pub collision_ping_count: usize,
    pub collision: Option<Publish>,
    pub events: VecDeque<Event>,
    pub write: BytesMut,
    // some fields omitted
}

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

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]

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]

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

impl Clone for MqttState[src]

impl Debug for MqttState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,