Trait sysinfo::UserExt[][src]

pub trait UserExt: Debug {
    fn get_name(&self) -> &str;
fn get_groups(&self) -> &[String]; }

Getting information for a user.

It is returned from SystemExt::get_users.

use sysinfo::{System, SystemExt, UserExt};

let mut s = System::new_all();
for user in s.get_users() {
    println!("{} is in {} groups", user.get_name(), user.get_groups().len());
}

Required methods

fn get_name(&self) -> &str[src]

Returns the name of the user.

use sysinfo::{System, SystemExt, UserExt};

let mut s = System::new_all();
for user in s.get_users() {
    println!("{}", user.get_name());
}

fn get_groups(&self) -> &[String][src]

Returns the groups of the user.

use sysinfo::{System, SystemExt, UserExt};

let mut s = System::new_all();
for user in s.get_users() {
    println!("{} is in {:?}", user.get_name(), user.get_groups());
}
Loading content...

Implementors

impl UserExt for User[src]

Loading content...