pub struct KernelPID(/* private fields */);
Expand description

Wrapper around a valid (not necessarily running, but in-range) riot_sys::kernel_pid_t that provides access to thread details and signaling.

Implementations§

source§

impl KernelPID

source

pub fn new(pid: kernel_pid_t) -> Option<Self>

source

pub fn all_pids() -> impl Iterator<Item = KernelPID>

source

pub fn get_name(&self) -> Option<&str>

source

pub fn status(&self) -> Result<Status, NoSuchThread>

Get the current status of the thread of that number, if one currently exists

source

pub fn wakeup(&self) -> Result<(), NoSuchThread>

source

pub fn priority(&self) -> Result<u8, NoSuchThread>

source

pub fn stack_stats(&self) -> Result<StackStats, StackStatsError>

Gather information about the stack’s thread.

A None being returned can have two reasons:

  • The thread does not exist, or
  • develhelp is not active.

This is not backed by C functions (as most of the rest of this crate is), but rather a practical way to access struct members that may or may not be present in a build.

Trait Implementations§

source§

impl Clone for KernelPID

source§

fn clone(&self) -> KernelPID

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 Debug for KernelPID

source§

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

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

impl Into<i16> for &KernelPID

source§

fn into(self) -> kernel_pid_t

Converts this type into the (usually inferred) input type.
source§

impl Into<i16> for KernelPID

source§

fn into(self) -> kernel_pid_t

Converts this type into the (usually inferred) input type.
source§

impl PartialEq for KernelPID

source§

fn eq(&self, other: &KernelPID) -> 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 Copy for KernelPID

source§

impl StructuralPartialEq for KernelPID

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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> IntoSwitch for T

source§

fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>

Consumes the IoPin returning a Switch of the appropriate ActiveLevel. Read more
source§

fn into_active_low_switch(self) -> Switch<Self, ActiveLow>
where Self: Sized,

Consumes the IoPin returning a Switch<IoPin, ActiveLow>. Read more
source§

fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>
where Self: Sized,

Consumes the IoPin returning a Switch<IoPin, ActiveHigh>. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.