is_windows

Function is_windows 

Source
pub const fn is_windows() -> bool
Expand 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

  • true on Windows (any Windows target)
  • false on 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