use std::fmt::{self, Debug, Formatter};
impmod! {
local_socket::peer_creds,
PeerCreds as Inner,
Pid,
}
#[derive(Copy, Clone)]
pub struct PeerCreds(Inner);
impl Debug for PeerCreds {
#[inline]
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { Debug::fmt(&self.0, f) }
}
impl From<Inner> for PeerCreds {
#[inline(always)]
fn from(v: Inner) -> Self { Self(v) }
}
impl PeerCreds {
#[inline]
pub fn pid(&self) -> Option<Pid> { self.0.pid() }
#[cfg(any(doc, unix))]
#[cfg_attr(feature = "doc_cfg", doc(cfg(unix)))]
#[inline]
pub fn euid(&self) -> Option<uid_t> { self.0.euid() }
#[cfg(any(doc, unix))]
#[cfg_attr(feature = "doc_cfg", doc(cfg(unix)))]
#[inline]
pub fn egid(&self) -> Option<gid_t> { self.0.egid() }
#[cfg(any(doc, unix))]
#[cfg_attr(feature = "doc_cfg", doc(cfg(unix)))]
#[inline]
pub fn groups(&self) -> Option<&[gid_t]> { self.0.groups() }
}
#[cfg(unix)]
use libc::{gid_t, uid_t};
#[cfg(not(unix))]
#[cfg_attr(not(doc), allow(unused_imports))]
use {u32 as uid_t, u32 as gid_t};