pub struct Credentials { /* private fields */ }Expand description
Credentials of a peer connection.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn unix_user_id(&self) -> Uid
pub fn unix_user_id(&self) -> Uid
The numeric Unix user ID, as defined by POSIX.
Sourcepub fn process_id(&self) -> Pid
pub fn process_id(&self) -> Pid
The numeric process ID, on platforms that have this concept.
On Unix, this is the process ID defined by POSIX.
Sourcepub fn unix_primary_group_id(&self) -> Gid
pub fn unix_primary_group_id(&self) -> Gid
The numeric Unix group ID, as defined by POSIX.
Sourcepub fn unix_supplementary_group_ids(&self) -> &[Gid]
pub fn unix_supplementary_group_ids(&self) -> &[Gid]
The set of numeric supplementary Unix group IDs, as defined by POSIX.
Currently, this method is only available for Linux targets.
Sourcepub fn process_fd(&self) -> Option<BorrowedFd<'_>>
pub fn process_fd(&self) -> Option<BorrowedFd<'_>>
A file descriptor pinning the process, on platforms that have this concept.
On Linux, the SO_PEERPIDFD socket option is a suitable implementation. This is safer to use to identify a process than the ProcessID, as the latter is subject to re-use attacks, while the FD cannot be recycled. If the original process no longer exists the FD will no longer be resolvable. The SO_PEERPIDFD socket option was added to Linux in version 6.5. This method will return None on older kernel versions.