pub const fn is_windows() -> boolExpand description
Checks if the current platform is Windows.
This is a compile-time check that returns true if the code is compiled
for Windows targets, false otherwise. It’s used throughout the codebase
to handle Windows-specific behavior.
§Returns
trueon Windows (any Windows target)falseon Unix-like systems (macOS, Linux, BSD, etc.)
§Examples
use agpm_cli::utils::platform::is_windows;
if is_windows() {
println!("Windows-specific code path");
} else {
println!("Unix-like system code path");
}§Use Cases
- Conditional compilation of platform-specific code
- Different path handling logic
- Platform-specific error messages
- Command execution differences