Skip to main content

detect_os

Function detect_os 

Source
pub const fn detect_os() -> Option<Os>
Expand description

The operating system this binary was compiled for, or None when that is not one of the three documented systems.

Resolved from cfg!, not from a runtime probe: a binary compiled for one operating system cannot be running on another, and a compile-time answer cannot be wrong about the thing it is most likely to be asked during an incident.