pub fn detect_wsl2() -> WslStatusExpand description
Detect WSL2 availability on the current system.
Returns a WslStatus indicating whether WSL2 is available, not installed,
or if detection encountered an error. Detection completes within 5 seconds
and never panics.
§Platform Behavior
- Windows: Checks
wsl --list --verboseoutput for version 2 distros - Linux: Checks
/proc/versionfor WSL indicators (running inside WSL)
§Examples
use rusty_stack::platform::wsl::detect_wsl2;
let status = detect_wsl2();
println!("WSL2 status: {:?}", status);