pub struct Inbox(/* private fields */);Expand description
The messages arriving on a transport’s connection, readable apart from the transport.
recv borrows the transport for as long as it waits, so a program that
waits for commands in one task while it publishes readings from another takes an inbox
with MqttTransport::inbox and waits on that instead. The inbox follows the transport
across reconnects.
Implementations§
Source§impl Inbox
impl Inbox
Sourcepub async fn recv(&self) -> Result<Option<Message>>
pub async fn recv(&self) -> Result<Option<Message>>
Awaits the next message from any subscribed topic.
§Returns
Some(message) for the next queued message, or None once the connection has
ended and its reason has been reported.
§Errors
Returns Error::Closed if the transport is not connected, or
Error::Transport once, saying why, when the connection ended on its own.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Inbox
impl !UnwindSafe for Inbox
impl Freeze for Inbox
impl Send for Inbox
impl Sync for Inbox
impl Unpin for Inbox
impl UnsafeUnpin for Inbox
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