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 usagedebug_logging: Enable debug logging of profiling functionsanalyze_tool: Include dependencies required only forthag_profilebinary.instrument_tool: Include dependencies required only forthag_instrumentandthag_uninstrumentbinaries.
Macros§
- ansi_
styling_ support - Generate ANSI styling support including trait and implementation.
- category_
enum - Generates a
Categoryenum with predefined variants and utility implementations for use with thethag_gen_readmeutility 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 aprofile!macro with the same name argument, and also explicitly drops the profile in ring-fenced profiler code. - file_
navigator - Generates a
FileNavigatorto 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 optionalend!macro with a matching name argument. - repeat_
dash - Generates a constant
DASH_LINEconsisting of a dash (hyphen) repeated the number of times specified by the integer literal argumentn. - safe_
alloc_ private - Internal proc macro for use by
thag_profilercode 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 usermainfunction in order to to enable and control profiling of the user code. - fn_name
- Define common errors for
thagtools. - profiled
- Attribute macro for use with
thag_profiler. This macro is intended to annotate user functions other thanmainin order to to control profiling of each function individually. - timing
- Measures and displays function execution time.
Derive Macros§
- Palette
Methods - Generates repetitive methods for all 14
Stylefields of thePalettestruct instead of hand-coding them.