pub struct UnixCredentials {
pub pid: u32,
pub uid: u32,
pub gid: u32,
/* private fields */
}Expand description
Transport-owned Unix credentials plus an optional OS identity generation.
pid, uid, and gid are ABI-compatible fallback values. OS layers with
PID namespaces can attach their generation object opaquely so queued
messages and peer sockets do not depend on a reusable numeric PID.
Fields§
§pid: u32Process ID.
uid: u32User ID.
gid: u32Group ID.
Implementations§
Source§impl UnixCredentials
impl UnixCredentials
Sourcepub fn new(pid: u32) -> Self
pub fn new(pid: u32) -> Self
Create a new UnixCredentials with the given PID and default UID/GID.
Sourcepub fn from_parts(pid: u32, uid: u32, gid: u32) -> Self
pub fn from_parts(pid: u32, uid: u32, gid: u32) -> Self
Creates credentials with explicit numeric fallback values.
Sourcepub fn with_identity<T>(self, identity: Arc<T>) -> Self
pub fn with_identity<T>(self, identity: Arc<T>) -> Self
Attaches an OS-specific stable process generation.
Trait Implementations§
Source§impl Clone for UnixCredentials
impl Clone for UnixCredentials
Source§fn clone(&self) -> UnixCredentials
fn clone(&self) -> UnixCredentials
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnixCredentials
impl Debug for UnixCredentials
Source§impl Default for UnixCredentials
impl Default for UnixCredentials
Source§fn default() -> UnixCredentials
fn default() -> UnixCredentials
Returns the “default value” for a type. Read more
impl Eq for UnixCredentials
Source§impl From<u32> for UnixCredentials
impl From<u32> for UnixCredentials
Auto Trait Implementations§
impl !RefUnwindSafe for UnixCredentials
impl !UnwindSafe for UnixCredentials
impl Freeze for UnixCredentials
impl Send for UnixCredentials
impl Sync for UnixCredentials
impl Unpin for UnixCredentials
impl UnsafeUnpin for UnixCredentials
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.