pub struct Uid(/* private fields */);Available on crate feature
thread only.Expand description
uid_t—A Unix user ID.
Implementations§
Source§impl Uid
impl Uid
Sourcepub const ROOT: Self
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
pub const ROOT: Self
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.A Uid corresponding to the root user (uid 0).
Sourcepub fn from_raw(raw: RawUid) -> Self
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
pub fn from_raw(raw: RawUid) -> Self
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Converts a RawUid into a Uid.
raw must be the value of a valid Unix user ID, and not -1.
Sourcepub const fn from_raw_unchecked(raw: RawUid) -> Self
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
pub const fn from_raw_unchecked(raw: RawUid) -> Self
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Converts a RawUid into a Uid.
raw must be the value of a valid Unix user ID, and not -1.
Sourcepub const fn as_raw(self) -> RawUid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
pub const fn as_raw(self) -> RawUid
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Converts a Uid into a RawUid.
Sourcepub const fn is_root(self) -> bool
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
pub const fn is_root(self) -> bool
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Test whether this uid represents the root user (Uid::ROOT).
Trait Implementations§
Source§impl Binary for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl Binary for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl Clone for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl Clone for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl Debug for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl Debug for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl Display for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl Display for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl Hash for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl Hash for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl LowerExp for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl LowerExp for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl LowerHex for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl LowerHex for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl Octal for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl Octal for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl PartialEq for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl PartialEq for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl UpperExp for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl UpperExp for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Source§impl UpperHex for Uid
Available on neither Windows nor WASI and (crate feature fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.
impl UpperHex for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.impl Copy for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.impl Eq for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.impl StructuralPartialEq for Uid
Available on neither Windows nor WASI and (crate feature
fs, or crate feature process, or crate feature thread, or linux_raw and non-crate feature use-libc-auxv and non-crate feature use-explicitly-provided-auxv and (crate feature param or crate feature runtime or crate feature time or x86), or linux_kernel and crate feature net) only.Auto Trait Implementations§
impl Freeze for Uid
impl RefUnwindSafe for Uid
impl Send for Uid
impl Sync for Uid
impl Unpin for Uid
impl UnsafeUnpin for Uid
impl UnwindSafe for Uid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more