Crate thag_proc_macros

Crate thag_proc_macros 

Source
Expand description

§thag_proc_macros

Proc macros for thag_rs (thag) and its subcrates.

§Features

  • time_profiling: Enable time-based performance profiling (default)
  • full_profiling: Enable comprehensive profiling including time and memory usage
  • debug_logging: Enable debug logging of profiling functions
  • analyze_tool: Include dependencies required only for thag_profile binary.
  • instrument_tool: Include dependencies required only for thag_instrument and thag_uninstrument binaries.

Macros§

ansi_styling_support
Generate ANSI styling support including trait and implementation.
category_enum
Generates a Category enum with predefined variants and utility implementations for use with the thag_gen_readme utility to generate a README.md for a directory such as demo/.
end
Proc macro for use with thag_profiler. This macro defines the end of the scope of a profile! macro with the same name argument, and also explicitly drops the profile in ring-fenced profiler code.
file_navigator
Generates a FileNavigator to allow the user to navigate the file system and select files and directories from a command-line interface.
preload_themes
Preload visual themes into memory at compile time.
profile
Proc macro for use with thag_profiler. This macro profiles a section of user code between itself and an optional end! macro with a matching name argument.
repeat_dash
Generates a constant DASH_LINE consisting of a dash (hyphen) repeated the number of times specified by the integer literal argument n.
safe_alloc_private
Internal proc macro for use by thag_profiler code to ring-fence profiler code.
safe_eprint
Synchronized eprint! macro that prevents terminal corruption from concurrent output.
safe_eprintln
Synchronized eprintln! macro that prevents terminal corruption from concurrent output.
safe_osc
Synchronized OSC sequence output macro that prevents terminal corruption.
safe_print
Synchronized print! macro that prevents terminal corruption from concurrent output.
safe_println
Synchronized println! macro that prevents terminal corruption from concurrent output.
styled
Applies styling to text using inline color and style codes.

Attribute Macros§

enable_profiling
Attribute macro for use with thag_profiler. This macro is intended to annotate the user main function in order to to enable and control profiling of the user code.
fn_name
Define common errors for thag tools.
profiled
Attribute macro for use with thag_profiler. This macro is intended to annotate user functions other than main in order to to control profiling of each function individually.
timing
Measures and displays function execution time.

Derive Macros§

PaletteMethods
Generates repetitive methods for all 14 Style fields of the Palette struct instead of hand-coding them.