[][src]Struct yaar::task::Task

pub struct Task { /* fields omitted */ }

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

impl Send for Task

impl Sync for Task

impl Unpin for Task

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.