Struct aws_iot_device_sdk_rust::EventLoop
source · pub struct EventLoop {
pub options: MqttOptions,
pub state: MqttState,
pub requests_rx: Receiver<Request>,
pub requests_tx: Sender<Request>,
pub pending: IntoIter<Request>,
/* private fields */
}Expand description
Eventloop with all the state of a connection
Fields§
§options: MqttOptionsOptions of the current mqtt connection
state: MqttStateCurrent 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§
source§impl EventLoop
impl EventLoop
sourcepub fn new(options: MqttOptions, cap: usize) -> EventLoop
pub fn new(options: MqttOptions, cap: usize) -> EventLoop
New MQTT EventLoop
When connection encounters critical errors (like auth failure), user has a choice to
access and update options, state and requests.
sourcepub async fn poll(&mut self) -> Result<Event, ConnectionError>
pub async fn poll(&mut self) -> Result<Event, ConnectionError>
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§
impl !Freeze for EventLoop
impl !RefUnwindSafe for EventLoop
impl Send for EventLoop
impl !Sync for EventLoop
impl Unpin for EventLoop
impl !UnwindSafe for EventLoop
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