Struct r3::kernel::LocalTask

source ·
pub struct LocalTask<System>(_, _)
where
    System: KernelBase
;
Expand description

A non-Send, 'static task reference. The lack of Send-ness constrains its lifetime to the owning task and thus allows it to represent a current task safely.

See TaskRef for the Send counterpart. See TaskMethods for the operations provided by this handle type.

Implementations

Get the current task (i.e., the task that is assigned to the current processor and in the Running state).

Returns GetCurrentTaskError::BadContext if called from a non-task context.

Rationale: Getting a current task in a non-task context does make sense, but the result may be soon invalidated (potentially violating the [object safety] of LocalTask) and made unreliable by various factors.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The system type this object pertains to.
Construct a Task from RawTaskId. Read more
Get the raw RawTaskId value representing this object.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Start the execution of the task.
Interrupt any ongoing wait operations undertaken by the task. Read more
Make the task’s token available, unblocking Kernel::park now or in the future. Read more
Make exactly one new token available for the task, unblocking Kernel::park now or in the future. Read more
Set the task’s base priority. Read more
Get the task’s base priority. Read more
Get the task’s effective priority. Read more
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.