pub struct User {
pub name: String,
pub fullname: String,
pub homedir: String,
pub shell: String,
pub passwd: Option<String>,
pub uid: c_uint,
pub gid: c_uint,
}
Expand description
User information struct
Fields§
§name: String
Username
fullname: String
Full name of the user
homedir: String
Home directory
shell: String
Path to the shell in use
passwd: Option<String>
User password. Can be equal to ‘x’ what means that, the password is stored in shadow. Check Shadow
struct.
uid: c_uint
User ID
gid: c_uint
Group ID, which is created for that user
Implementations§
Source§impl User
impl User
Sourcepub fn new_from_uid(uid: c_uint) -> Result<Self>
pub fn new_from_uid(uid: c_uint) -> Result<Self>
Get user information by user ID
Sourcepub fn new_from_name(name: &str) -> Result<Self>
pub fn new_from_name(name: &str) -> Result<Self>
Get user information by it’s username
Sourcepub fn current_user() -> Result<Self>
pub fn current_user() -> Result<Self>
Fetch information about current 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