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 PartialOrd for User
impl PartialOrd for User
impl 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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more