pub struct NeedsYield { /* private fields */ }
Expand description
An object that can be polled to see if a yield has been requested.
Implementations§
Source§impl NeedsYield
impl NeedsYield
Sourcepub fn request_yield(&self) -> bool
pub fn request_yield(&self) -> bool
Requests a yield.
Returns whether a signal is necessary to ensure that the task yields soon.
Sourcepub async fn maybe_yield(&self)
pub async fn maybe_yield(&self)
Yields execution to the executor if request_yield
has been called
since the last call to maybe_yield
.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NeedsYield
impl RefUnwindSafe for NeedsYield
impl Send for NeedsYield
impl Sync for NeedsYield
impl Unpin for NeedsYield
impl UnwindSafe for NeedsYield
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