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 process_fd(&self) -> BorrowedFd<'_>
pub fn process_fd(&self) -> 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
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