Skip to main content

UserExt

Trait UserExt 

Source
pub trait UserExt {
    // Required methods
    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;
}
Expand description

Linux-specific extensions for User.

In Linux user information is provided by utmpx (see man utmpx(5)), trait methods are representing fields of this struct.

Required Methods§

Source

fn pid(&self) -> Pid

Returns the Pid of login process.

Source

fn terminal(&self) -> &str

Returns the tty or pseudo-tty name associated with user.

Source

fn id(&self) -> &str

Returns the terminal identifier.

Source

fn hostname(&self) -> &str

Returns the hostname for remote login.

Source

fn address(&self) -> Option<IpAddr>

Returns the IP address of remote host.

Source

fn session_id(&self) -> i32

Returns the Session ID.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl UserExt for User

Available on Linux only.