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§

source§

impl<System> LocalTask<System>where System: KernelBase,

source

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,

source§

fn clone(&self) -> LocalTask<System>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<System> Debug for LocalTask<System>where System: KernelBase,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<System> Hash for LocalTask<System>where System: KernelBase,

source§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<System, T> PartialEq<T> for LocalTask<System>where System: KernelBase, T: TaskHandle<System = System>,

source§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<System> TaskHandle for LocalTask<System>where System: KernelBase,

§

type System = System

The system type this object pertains to.
source§

const unsafe fn from_id( id: <System as KernelBase>::RawTaskId ) -> LocalTask<System>

Construct a Task from RawTaskId. Read more
source§

const fn id(&self) -> <System as KernelBase>::RawTaskId

Get the raw RawTaskId value representing this object.
source§

const fn borrow(&self) -> TaskRef<'_, <LocalTask<System> as TaskHandle>::System>

Borrow self as TaskRef.
source§

impl<System> Copy for LocalTask<System>where System: KernelBase,

source§

impl<System> Eq for LocalTask<System>where System: KernelBase,

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> TaskMethods for Twhere T: TaskHandle,

source§

fn activate(&self) -> Result<(), ActivateTaskError>

Start the execution of the task.
source§

fn interrupt(&self) -> Result<(), InterruptTaskError>

Interrupt any ongoing wait operations undertaken by the task. Read more
source§

fn unpark(&self) -> Result<(), UnparkError>

Make the task’s token available, unblocking Kernel::park now or in the future. Read more
source§

fn unpark_exact(&self) -> Result<(), UnparkExactError>

Make exactly one new token available for the task, unblocking Kernel::park now or in the future. Read more
source§

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>

Get the task’s base priority. Read more
source§

fn effective_priority(&self) -> Result<usize, GetTaskPriorityError>

Get the task’s effective priority. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.