Struct rumqttc_async_std::EventLoop[][src]

pub struct EventLoop {
    pub options: MqttOptions,
    pub state: MqttState,
    pub requests_rx: Receiver<Request>,
    pub requests_tx: Sender<Request>,
    pub pending: IntoIter<Request>,
    // some fields omitted
}

Eventloop with all the state of a connection

Fields

options: MqttOptions

Options of the current mqtt connection

state: MqttState

Current state of the connection

requests_rx: Receiver<Request>

Request stream

requests_tx: Sender<Request>

Requests handle to send requests

pending: IntoIter<Request>

Pending packets from last session

Implementations

impl EventLoop[src]

pub fn new(options: MqttOptions, cap: usize) -> EventLoop[src]

New MQTT EventLoop

When connection encounters critical errors (like auth failure), user has a choice to access and update options, state and requests.

pub fn handle(&self) -> Sender<Request>[src]

Returns a handle to communicate with this eventloop

#[must_use = "Eventloop should be iterated over a loop to make progress"]pub async fn poll(&mut self) -> Result<Event, ConnectionError>[src]

Yields Next notification or outgoing request and periodically pings the broker. Continuing to poll will reconnect to the broker if there is a disconnection. NOTE Don't block this while iterating

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, 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>,