Skip to main content

peer_cred

Function peer_cred 

Source
pub fn peer_cred(stream: &UnixStream) -> Result<PeerCred>
Expand description

Read the peer credentials of a connected unix-socket stream (PRODUCT.md A.3).

Uses tokio’s built-in peer_cred() which calls SO_PEERCRED (Linux) or getpeereid (macOS) through the kernel. pid is -1 on platforms where it is not available in a single call.