pub struct TokioYield;Available on crate feature
async-tokio only.Expand description
An implementation of SleepProvider using Tokio’s yield.
This strategy avoids timer-based delays by yielding to the scheduler immediately, which can improve responsiveness in low-concurrency scenarios.
However, it comes at the cost of more frequent rescheduling, which can
result in tighter polling loops and increased CPU usage under load. In
highly concurrent cases, a timer-based sleep (e.g., TokioSleep) is often
more efficient due to reduced scheduler churn.
Trait Implementations§
Source§impl SleepProvider for TokioYield
Available on crate features async-tokio or async-smol only.
impl SleepProvider for TokioYield
Available on crate features
async-tokio or async-smol only.Auto Trait Implementations§
impl Freeze for TokioYield
impl RefUnwindSafe for TokioYield
impl Send for TokioYield
impl Sync for TokioYield
impl Unpin for TokioYield
impl UnwindSafe for TokioYield
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