pub struct MetadataRef { /* private fields */ }Expand description
A reference to metadata of a particular task
Implementations§
Source§impl MetadataRef
impl MetadataRef
Sourcepub fn for_current_task() -> impl Future<Output = Self>
pub fn for_current_task() -> impl Future<Output = Self>
Get the metadata for the current task.
You can use this to read or modify the current task’s metadata.
This function is async just to get access to the current async
context. It returns instantly, it does not block/yield.
Sourcepub fn set_priority(&self, priority: u8)
pub fn set_priority(&self, priority: u8)
Set this task’s priority.
Sourcepub fn set_deadline(&self, instant_ticks: u64)
pub fn set_deadline(&self, instant_ticks: u64)
Set this task’s deadline.
This method does NOT check whether the deadline has already passed.
Sourcepub fn unset_deadline(&self)
pub fn unset_deadline(&self)
Remove this task’s deadline. This brings it back to the defaul where it’s not scheduled ahead of other tasks.
Sourcepub fn increment_deadline(&self, duration_ticks: u64)
pub fn increment_deadline(&self, duration_ticks: u64)
Set the this task’s deadline increment_ticks from the previous deadline.
This deadline is saturated to the max tick value.
Note that by default (unless otherwise set), tasks start life with the deadline not set, which means this method will have no effect.
Analogous to one increment of Ticker::every().next().
Returns the deadline that was set.