[−][src]Struct yaar::task::Task
Minimal state used to represent a generic unit of execution used by the executors in the runtime.
Methods
impl Task
[src]
pub fn new(priority: Priority, resume: unsafe fn(_: *mut Task)) -> Self
[src]
Create a new task with the given priority and resume function. The resume function is called when the thread is woken up by the scheduler internally to start executing its corresponding unit (not limited to futures).
pub fn next(&self) -> Option<NonNull<Self>>
[src]
Get the link provided by the task as it can function as a linked list node.
pub fn set_next(&mut self, next: Option<NonNull<Self>>)
[src]
Get the next task link having the task act as a linked list node.
pub fn set_priority(&mut self, priority: Priority)
[src]
Modify the runtime priority of the task. Should only be called before the task is resumed as the scheduler could also have ownership internally.
pub fn priority(&self) -> Priority
[src]
Get the assigned priority of the task.
pub fn resume(&mut self)
[src]
Call the resume function provided by [new
]
using the given task as a parameter.
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,