pub struct ThreadMetadata {
pub thread: ThreadHandle,
pub name: Bytes<MAX_TASK_NAME_LEN>,
pub stack_depth: StackType,
pub priority: UBaseType,
pub thread_number: UBaseType,
pub state: ThreadState,
pub current_priority: UBaseType,
pub base_priority: UBaseType,
pub run_time_counter: UBaseType,
pub stack_high_water_mark: StackType,
}Expand description
Metadata and runtime information about a thread.
Contains detailed information about a thread’s state, priorities, stack usage, and runtime statistics.
§Examples
ⓘ
use osal_rs::os::Thread;
let thread = Thread::current();
let metadata = thread.metadata().unwrap();
println!("Thread: {}", metadata.name);
println!("Priority: {}", metadata.priority);
println!("Stack high water mark: {}", metadata.stack_high_water_mark);Fields§
§thread: ThreadHandleFreeRTOS task handle
name: Bytes<MAX_TASK_NAME_LEN>Thread name
stack_depth: StackTypeOriginal stack depth allocated for this thread
priority: UBaseTypeThread priority
thread_number: UBaseTypeUnique thread number assigned by FreeRTOS
state: ThreadStateCurrent execution state
current_priority: UBaseTypeCurrent priority (may differ from base priority due to priority inheritance)
base_priority: UBaseTypeBase priority without inheritance
run_time_counter: UBaseTypeTotal runtime counter (requires configGENERATE_RUN_TIME_STATS)
stack_high_water_mark: StackTypeMinimum remaining stack space ever recorded (lower values indicate higher stack usage)
Trait Implementations§
Source§impl Clone for ThreadMetadata
impl Clone for ThreadMetadata
Source§fn clone(&self) -> ThreadMetadata
fn clone(&self) -> ThreadMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreadMetadata
impl Debug for ThreadMetadata
Source§impl Default for ThreadMetadata
impl Default for ThreadMetadata
Source§impl From<(*const c_void, TaskStatus)> for ThreadMetadata
impl From<(*const c_void, TaskStatus)> for ThreadMetadata
Source§fn from(status: (ThreadHandle, TaskStatus)) -> Self
fn from(status: (ThreadHandle, TaskStatus)) -> Self
Converts to this type from the input type.
impl Send for ThreadMetadata
impl Sync for ThreadMetadata
Auto Trait Implementations§
impl Freeze for ThreadMetadata
impl RefUnwindSafe for ThreadMetadata
impl Unpin for ThreadMetadata
impl UnwindSafe for ThreadMetadata
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
Mutably borrows from an owned value. Read more