pub fn is_root() -> boolExpand 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.