Struct nix::unistd::Uid
pub struct Uid(_);
Documentation
User identifier
Newtype pattern around uid_t
(which is just alias). It prevents bugs caused by accidentally
passing wrong value.
Implementations
impl Uid
pub const fn from_raw(uid: uid_t) -> Self
Creates Uid
from raw uid_t
.
pub fn current() -> Self
Returns Uid of calling process. This is practically a more Rusty alias for getuid
.
pub fn effective() -> Self
Returns effective Uid of calling process. This is practically a more Rusty alias for geteuid
.
pub const fn is_root(Self) -> bool
Returns true if the Uid
represents privileged user - root. (If it equals zero.)
pub const fn as_raw(Self) -> uid_t
Get the raw uid_t
wrapped by self
.
Trait Implementations
impl Debug for Uid
fn fmt(&Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for Uid
fn fmt(&Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Hash for Uid
fn hash<__H: $crate::hash::Hasher>(&Self, state: &mut __H) -> ()
impl StructuralEq for Uid
impl StructuralPartialEq for Uid
Auto Trait Implementations
impl RefUnwindSafe for Uid
impl UnwindSafe for Uid
Blanket Implementations
impl<T> BorrowMut<T> for T
where
T: ?Sized,
where
T: ?Sized,
fn borrow_mut(&mut Self) -> &mut T