pub struct MqttEventLoop<'l, M: RawMutex, const B: usize> { /* private fields */ }Expand description
The main eventloop of the MQTT client
This struct holds all state an buffers for the mqtt client
Implementations§
Source§impl<M: RawMutex, const B: usize> MqttEventLoop<'static, M, B>
impl<M: RawMutex, const B: usize> MqttEventLoop<'static, M, B>
Sourcepub fn new(config: ClientConfig) -> Self
pub fn new(config: ClientConfig) -> Self
Create a new event loop
Source§impl<'l, M: RawMutex, const B: usize> MqttEventLoop<'l, M, B>
impl<'l, M: RawMutex, const B: usize> MqttEventLoop<'l, M, B>
pub fn new_with_last_will(config: ClientConfig, last_will: LastWill<'l>) -> Self
Sourcepub fn client<'a>(&'a self) -> MqttClient<'a, M>
pub fn client<'a>(&'a self) -> MqttClient<'a, M>
Create a client for the event loop. The Client can be used to publish and receive messages, …
There can be multiple MqttClient for one MqttEventLoop.
But concurrent receives from multiple clients result in not all clients to receive all publishes
pub async fn run<N: NetworkConnection>( &self, connection: Pin<&mut N>, ) -> Result<(), MqttError>
Auto Trait Implementations§
impl<'l, M, const B: usize> !Freeze for MqttEventLoop<'l, M, B>
impl<'l, M, const B: usize> !RefUnwindSafe for MqttEventLoop<'l, M, B>
impl<'l, M, const B: usize> Send for MqttEventLoop<'l, M, B>where
M: Send,
impl<'l, M, const B: usize> !Sync for MqttEventLoop<'l, M, B>
impl<'l, M, const B: usize> Unpin for MqttEventLoop<'l, M, B>where
M: Unpin,
impl<'l, M, const B: usize> UnwindSafe for MqttEventLoop<'l, M, B>where
M: UnwindSafe,
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