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
All OSAL trait definitions for advanced usage. 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::*;
let thread = Thread::get_current();
let metadata = thread.get_metadata();
// Name, priority and stack usage are all part of the snapshot.
let _ = (metadata.name.as_str(), metadata.priority, metadata.stack_high_water_mark);
assert_ne!(metadata.state, ThreadState::Invalid);Fields§
§thread: ThreadHandleOS-level thread/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 OS
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 (const: unstable) · 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.