pub struct SendWaiter<'s>(/* private fields */);esp-now and unstable only.Expand description
This struct is returned by a sync esp now send. Invoking wait method of
this struct will block current task until the callback function of esp now
send is called and return the status of previous sending.
This waiter borrows the sender, so when used in multiple tasks, the lock
will only be released when the waiter is dropped or consumed via wait.
When using a lock that disables interrupts, the waiter will block forever since the callback which signals the completion of sending will never be invoked.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl SendWaiter<'_>
impl SendWaiter<'_>
Sourcepub fn wait(self) -> Result<(), EspNowError>
pub fn wait(self) -> Result<(), EspNowError>
Wait for the previous sending to complete, i.e. the send callback is invoked with status of the sending.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Trait Implementations§
Source§impl Drop for SendWaiter<'_>
impl Drop for SendWaiter<'_>
Source§fn drop(&mut self)
fn drop(&mut self)
wait for the send to complete to prevent the lock on EspNowSender get
unlocked before a callback is invoked.
§fn pin_drop(self: Pin<&mut Self>)
fn pin_drop(self: Pin<&mut Self>)
pin_ergonomics)Drop::drop, it requires self
to be pinned. Read more