diff --git a/library/std/src/sys/unix/ext/ucred.rs b/library/std/src/sys/unix/ext/ucred.rs index f7af9f5e96e..97f10e52b06 100644 --- a/library/std/src/sys/unix/ext/ucred.rs +++ b/library/std/src/sys/unix/ext/ucred.rs @@ -12,9 +12,16 @@ use libc::{gid_t, pid_t, uid_t}; #[unstable(feature = "peer_credentials_unix_socket", issue = "42839", reason = "unstable")] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct UCred { + /// The UID part of the peer credential. This is the effective UID of the process at the domain + /// socket's endpoint. pub uid: uid_t, + /// The GID part of the peer credential. This is the effective GID of the process at the domain + /// socket's endpoint. pub gid: gid_t, - // pid field is an option because it is not supported on some platforms. + /// The PID part of the peer credential. This field is optional because the PID part of the + /// peer credentials is not supported on every platform. On platforms where the mechanism to + /// discover the PID exists, this field will be populated to the PID of the process at the + /// domain socket's endpoint. Otherwise, it will be set to None. pub pid: Option, }