pub trait WaitStrategy {
// Required methods
fn reset(&mut self);
fn wait(&mut self);
}Expand description
Progressive backoff when polling.
This trait is intentionally minimal and no_std-friendly.
It is typically used at the edges (router loops, receive loops) to avoid busy-spinning.
§Contract
- Implementations should be cheap and panic-free.
waitmay spin, yield, or sleep depending on the strategy.- Callers should treat
waitas a hint; it does not guarantee that the observed condition will change.
Required Methods§
Implementors§
impl WaitStrategy for SpinWait
impl WaitStrategy for StdBackoff
Available on crate feature
std only.impl WaitStrategy for YieldWait
Available on crate feature
std only.