pub struct LowPriorityTask(/* private fields */);Expand description
LowPriorityTask is to be used for tasks that are low priority. Low priority tasks should
periodically call wait_until_idle which will wait until no other normal priority tasks have
been running for the specified tasks. A normal priority task is any task that isn’t a low
priority one (due to creating an instance of LowPriorityTask).
Implementations§
Source§impl LowPriorityTask
impl LowPriorityTask
Sourcepub fn new() -> Self
pub fn new() -> Self
Marks the current task as a low priority task which means that it won’t count as activity
that wait_until_idle will respect.
§Panics
This will panic if there is no task currently running or if the task is already marked as a low priority task.
Sourcepub async fn wait_until_idle_for(
&self,
period: MonotonicDuration,
deadline: MonotonicInstant,
)
pub async fn wait_until_idle_for( &self, period: MonotonicDuration, deadline: MonotonicInstant, )
Waits until the executor has been idle for period i.e. no normal priority tasks have been
polled for period. deadline is the limit for how long this will wait.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LowPriorityTask
impl !RefUnwindSafe for LowPriorityTask
impl Send for LowPriorityTask
impl Sync for LowPriorityTask
impl Unpin for LowPriorityTask
impl !UnwindSafe for LowPriorityTask
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