Skip to main content

Module context

Module context 

Source
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§

AnalysisContext
Context snapshot for the current analysis operation.
ContextGuard
RAII guard for restoring analysis context on drop.

Enums§

AnalysisPhase
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).