Expand description
Thread-local context tracking for crash reports.
Provides context information about the current analysis phase and file being processed. Uses thread-local storage for per-thread context (works with rayon parallel iterators) and atomic counters for global progress.
§Thread Safety
- Thread-local context: Each thread has its own context (via
thread_local!) - Global progress: Atomic counters for files processed/total
- Context guards use RAII for automatic cleanup on drop
Structs§
- Analysis
Context - Context snapshot for the current analysis operation.
- Context
Guard - RAII guard for restoring analysis context on drop.
Enums§
- Analysis
Phase - Analysis phases for context tracking.
Functions§
- get_
current_ context - Get the current context snapshot.
- get_
progress - Get the current progress (processed, total).
- increment_
processed - Increment the processed file count.
- reset_
context - Reset the current thread’s context to empty.
- reset_
progress - Reset progress counters to zero.
- set_
current_ file - Set the current file being analyzed.
- set_
current_ function - Set the current function being analyzed.
- set_
phase - Set the current analysis phase.
- set_
phase_ persistent - Set the current analysis phase without returning a guard.
- set_
progress - Set the progress counters (processed and total files).