pub struct User { /* private fields */ }
Expand description
Type containing user information.
It is returned by Users
.
use sysinfo::Users;
let users = Users::new_with_refreshed_list();
for user in users.list() {
println!("{:?}", user);
}
Implementations§
source§impl User
impl User
sourcepub fn id(&self) -> &Uid
pub fn id(&self) -> &Uid
Returns the ID of the user.
use sysinfo::Users;
let users = Users::new_with_refreshed_list();
for user in users.list() {
println!("{:?}", *user.id());
}
sourcepub fn group_id(&self) -> Gid
pub fn group_id(&self) -> Gid
Returns the group ID of the user.
⚠️ This information is not set on Windows. Windows doesn’t have a username
specific
group assigned to the user. They do however have unique
Security Identifiers
made up of various Components.
Pieces of the SID may be a candidate for this field, but it doesn’t map well to a single
group ID.
use sysinfo::Users;
let users = Users::new_with_refreshed_list();
for user in users.list() {
println!("{}", *user.group_id());
}
Trait Implementations§
source§impl Ord for User
impl Ord for User
source§impl PartialEq for User
impl PartialEq for User
source§impl PartialOrd for User
impl PartialOrd for User
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more