Struct fundamentum_sdk_mqtt::EventLoop
source · pub struct EventLoop {
pub mqtt_options: MqttOptions,
pub state: MqttState,
pub pending: IntoIter<Request, Global>,
pub network_options: NetworkOptions,
/* private fields */
}Expand description
Eventloop with all the state of a connection
Fields§
§mqtt_options: MqttOptionsOptions of the current mqtt connection
state: MqttStateCurrent state of the connection
pending: IntoIter<Request, Global>Pending packets from last session
network_options: NetworkOptionsImplementations§
source§impl EventLoop
impl EventLoop
sourcepub fn new(mqtt_options: MqttOptions, cap: usize) -> EventLoop
pub fn new(mqtt_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
) -> impl Future<Output = Result<Event, ConnectionError>>
pub async fn poll( &mut self ) -> impl Future<Output = 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
pub fn network_options(&self) -> NetworkOptions
pub fn set_network_options( &mut self, network_options: NetworkOptions ) -> &mut EventLoop
Auto Trait Implementations§
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