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§
source§impl<System> LocalTask<System>where
System: KernelBase,
impl<System> LocalTask<System>where System: KernelBase,
sourcepub fn current() -> Result<LocalTask<System>, GetCurrentTaskError>
pub fn current() -> Result<LocalTask<System>, GetCurrentTaskError>
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§
source§impl<System> Clone for LocalTask<System>where
System: KernelBase,
impl<System> Clone for LocalTask<System>where System: KernelBase,
source§impl<System> Debug for LocalTask<System>where
System: KernelBase,
impl<System> Debug for LocalTask<System>where System: KernelBase,
source§impl<System> Hash for LocalTask<System>where
System: KernelBase,
impl<System> Hash for LocalTask<System>where System: KernelBase,
source§impl<System, T> PartialEq<T> for LocalTask<System>where
System: KernelBase,
T: TaskHandle<System = System>,
impl<System, T> PartialEq<T> for LocalTask<System>where System: KernelBase, T: TaskHandle<System = System>,
source§impl<System> TaskHandle for LocalTask<System>where
System: KernelBase,
impl<System> TaskHandle for LocalTask<System>where System: KernelBase,
impl<System> Copy for LocalTask<System>where System: KernelBase,
impl<System> Eq for LocalTask<System>where System: KernelBase,
impl<System> Sync for LocalTask<System>where System: KernelBase,
Auto Trait Implementations§
impl<System> RefUnwindSafe for LocalTask<System>where <System as KernelBase>::RawTaskId: RefUnwindSafe,
impl<System> !Send for LocalTask<System>
impl<System> Unpin for LocalTask<System>where <System as KernelBase>::RawTaskId: Unpin,
impl<System> UnwindSafe for LocalTask<System>where <System as KernelBase>::RawTaskId: UnwindSafe,
Blanket Implementations§
source§impl<T> TaskMethods for Twhere
T: TaskHandle,
impl<T> TaskMethods for Twhere T: TaskHandle,
source§fn interrupt(&self) -> Result<(), InterruptTaskError>
fn interrupt(&self) -> Result<(), InterruptTaskError>
Interrupt any ongoing wait operations undertaken by the task. Read more
source§fn unpark(&self) -> Result<(), UnparkError>
fn unpark(&self) -> Result<(), UnparkError>
Make the task’s token available, unblocking
Kernel::park
now or in
the future. Read moresource§fn unpark_exact(&self) -> Result<(), UnparkExactError>
fn unpark_exact(&self) -> Result<(), UnparkExactError>
Make exactly one new token available for the task, unblocking
Kernel::park
now or in the future. Read moresource§fn set_priority(&self, priority: usize) -> Result<(), SetTaskPriorityError>where
Self::System: KernelTaskSetPriority,
fn set_priority(&self, priority: usize) -> Result<(), SetTaskPriorityError>where Self::System: KernelTaskSetPriority,
Set the task’s base priority. Read more
source§fn priority(&self) -> Result<usize, GetTaskPriorityError>
fn priority(&self) -> Result<usize, GetTaskPriorityError>
Get the task’s base priority. Read more
source§fn effective_priority(&self) -> Result<usize, GetTaskPriorityError>
fn effective_priority(&self) -> Result<usize, GetTaskPriorityError>
Get the task’s effective priority. Read more