#[non_exhaustive]pub struct ThreadSample {
pub thread_id: u64,
pub started: Option<u64>,
pub wakeups: Option<u64>,
pub cpu_seconds: Option<f64>,
pub name: Option<String>,
pub start_address: Option<u64>,
}Expand description
One thread of the current process at the moment of a snapshot.
A figure the host cannot report for a thread is None, never zero.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.thread_id: u64OS thread id: the Windows thread id, the Linux tid, or the macOS libproc thread handle.
started: Option<u64>Creation time (Windows FILETIME ticks). Thread ids are reused, so (thread_id, started) is
what identifies a thread across snapshots. None where the host reports no creation time.
wakeups: Option<u64>Wake-ups since the thread started: Windows ContextSwitchCount (one switch-in per wake).
None on macOS and Linux.
cpu_seconds: Option<f64>CPU time (user plus kernel) since the thread started, in seconds. Windows only.
name: Option<String>Thread name when the thread set one (Windows SetThreadDescription, Linux comm, macOS
pth_name); None when it has none or the thread was gone before it could be read.
start_address: Option<u64>Windows Win32 start address of the thread (the routine handed to CreateThread, which for
a Rust thread is the std trampoline, so it tells a pool from a one-off but not the closure);
None elsewhere or when unreadable.