pub struct KernelPID(pub(crate) kernel_pid_t);
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.
Tuple Fields§
§0: kernel_pid_t
Implementations§
source§impl KernelPID
impl KernelPID
pub fn new(pid: kernel_pid_t) -> Option<Self>
pub fn all_pids() -> impl Iterator<Item = KernelPID>
pub fn get_name(&self) -> Option<&str>
sourcepub fn status(&self) -> Result<Status, NoSuchThread>
pub fn status(&self) -> Result<Status, NoSuchThread>
Get the current status of the thread of that number, if one currently exists
pub fn wakeup(&self) -> Result<(), NoSuchThread>
sourcefn thread(&self) -> Result<*const thread_t, NoSuchThread>
fn thread(&self) -> Result<*const thread_t, NoSuchThread>
Pick the thread_t out of sched_threads for the PID
pub fn priority(&self) -> Result<u8, NoSuchThread>
sourcepub fn stack_stats(&self) -> Result<StackStats, StackStatsError>
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 Into<i16> for &KernelPID
impl Into<i16> for &KernelPID
source§fn into(self) -> kernel_pid_t
fn into(self) -> kernel_pid_t
source§impl Into<i16> for KernelPID
impl Into<i16> for KernelPID
source§fn into(self) -> kernel_pid_t
fn into(self) -> kernel_pid_t
impl Copy for KernelPID
impl StructuralPartialEq for KernelPID
Auto Trait Implementations§
impl Freeze for KernelPID
impl RefUnwindSafe for KernelPID
impl Send for KernelPID
impl Sync for KernelPID
impl Unpin for KernelPID
impl UnwindSafe for KernelPID
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoSwitch for T
impl<T> IntoSwitch for T
source§fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
source§fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2 bytes