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
Thread/task management and notification types. 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ThreadMetadata
impl Debug for ThreadMetadata
Source§impl Default for ThreadMetadata
Provides default values for ThreadMetadata.
impl Default for ThreadMetadata
Provides default values for ThreadMetadata.
Creates a metadata instance with null/zero values, representing an invalid or uninitialized thread.
Source§impl From<(*const c_void, TaskStatus)> for ThreadMetadata
Converts a FreeRTOS TaskStatus into ThreadMetadata.
impl From<(*const c_void, TaskStatus)> for ThreadMetadata
Converts a FreeRTOS TaskStatus into ThreadMetadata.
This conversion extracts all relevant task information from the FreeRTOS TaskStatus structure and creates a safe Rust representation.