Expand description
Common types, macros, and utilities shared across thag_rs
subcrates.
This crate provides the foundational components that multiple thag_rs
subcrates depend on,
including verbosity control, color support detection, terminal background luminance,
utility macros, and common error handling patterns.
Modules§
- help_
system - Lightweight help system for thag tools
Macros§
- auto_
help - Macro to automatically extract help from current source file
- debug_
log - Debugging logger.
- help_
system - Macro to create a help system - manually specify the source
- lazy_
static_ var - Lazy-static variable generator.
- prtln
- Ungated print line macro for user messages
- re
- Lazy-static regular expression generator.
- set_
verbosity - Convenient macro for setting global verbosity with short syntax.
- static_
lazy - Creates a lazily-initialized static variable.
- vprtln
- Verbosity-gated print line macro for user messages
Structs§
- Color
Support Iter - An iterator over the variants of ColorSupport
- Output
Manager - Manages user message output with verbosity control and thread-safe locking
- Term
BgLuma Iter - An iterator over the variants of TermBgLuma
- Verbosity
Iter - An iterator over the variants of Verbosity
Enums§
- Color
Support - An enum to categorise the current terminal’s level of colour support as detected, configured or defaulted.
- Term
BgLuma - Terminal background luminance detection and specification
- Thag
Common Error - Error types for
thag_common
operations - Verbosity
- Controls the detail level of user messaging
Statics§
- OUTPUT_
MANAGER - Global output manager instance protected by a reentrant mutex for thread-safe access
Functions§
- debug_
timings - Developer method to log method timings.
- disentangle
- Unescape \n markers to convert a string of raw text to readable lines.
- escape_
path_ for_ windows - No-op function for non-Windows platforms.
- get_
home_ dir - Get the user’s home directory as a
PathBuf
. - get_
home_ dir_ string - Get the user’s home directory as a
String
. - get_
verbosity - Initializes and returns the global verbosity setting.
- init_
verbosity - Initialize verbosity with a convenient function that handles common patterns.
- reassemble
- Reassemble an Iterator of lines from the disentangle function to a string of text.
- set_
global_ verbosity - Set the output verbosity for the current execution.
- set_
verbosity_ from_ env - Set global verbosity from the
THAG_VERBOSITY
environment variable. - thousands
- Formats a given positive integer with thousands separators (commas).
Type Aliases§
- Thag
Common Result - Result type alias for
thag_common
operations - V
- Type alias for Verbosity to provide a shorter name for convenience