Skip to main content

is_root

Function is_root 

Source
pub fn is_root() -> bool
Expand description

Returns true when the current process is running with superuser / Administrator privileges.

  • Unix: true when the effective UID is 0.
  • Windows: true when the current process token is a member of the built-in Administrators group (checked via IsUserAnAdmin).
  • Other targets: always returns false.