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