use std::net::IpAddr;
use crate::Pid;
pub trait UserExt {
fn pid(&self) -> Pid;
fn terminal(&self) -> &str;
fn id(&self) -> &str;
fn hostname(&self) -> &str;
fn address(&self) -> Option<IpAddr>;
fn session_id(&self) -> i32;
}
#[cfg(target_os = "linux")]
impl UserExt for crate::User {
fn pid(&self) -> Pid {
self.as_ref().pid()
}
fn terminal(&self) -> &str {
self.as_ref().terminal()
}
fn id(&self) -> &str {
self.as_ref().id()
}
fn hostname(&self) -> &str {
self.as_ref().hostname()
}
fn address(&self) -> Option<IpAddr> {
self.as_ref().address()
}
fn session_id(&self) -> i32 {
self.as_ref().session_id()
}
}