Struct itron_solid_asp3::task::Task[][src]

pub struct Task(_);
This is supported on crate features unstable and dcre only.
Expand description

An owned task.

Deletes the task automatically when dropped. The destructor will panic if the deletion fails.

Implementations

acre_tsk: Create a builder for Task.

Example
use itron::task::Task;
let captured_variable = 42u16;
let task = Task::build()
    .start(move || { let _ = captured_variable; })
    .stack_size(4096)
    .initial_priority(4)
    .finish_and_activate()
    .expect("failed to create a task");

task.as_ref().wake().expect("failed to send a wake up request to the created task");

// The created task might be still active, so if we just let `task`
// go out of scope, its destructor will panic. `Task::leak` consumes
// `Task` and prevents the destructor from running.
task.leak();

Construct a Task from a raw object ID.

Safety

See Object ID Wrappers.

Consume and “leak” self, returning a reference TaskRef<'a>.

Get the raw object ID.

Get the raw object ID as abi::NonNullID.

Borrow Task as TaskRef.

Use this to perform operations on tasks because most of the methods are implemented on TaskRef but not Task.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.